Skip to contentSkip to conversation

request_region return value check

DISCUSSION Vivek Subbarao 2 participants 4 messages Jul 14, 2013 – Jul 15, 2013 Kernel janitors

lore
Share & tools
lore
#0 lore raw

There are many places where the return value from request_region is not checked for null value. This is required right ? I am just checking before I can send patched fixing them

#1 lore raw
Quoted 3 lines · Vivek Subbarao

There are many places where the return value from request_region is not checked for null value. This is required right ? I am just checking before I can send patched fixing them

Most of the time, but not always.

Sometimes people know it will succeed. The first one I looked at in drivers/acpi/acpi_processor.c the caller doesn't care if it succeeds and there is a comment explaining why.

regards,
dan carpenter

#2 lore raw
In reply to Vivek Subbarao
Quoted 11 lines · Dan Carpenter
Quoted 3 lines · Vivek Subbarao

There are many places where the return value from request_region is not checked for null value. This is required right ? I am just checking before I can send patched fixing them

Most of the time, but not always.

Sometimes people know it will succeed. The first one I looked at in drivers/acpi/acpi_processor.c the caller doesn't care if it succeeds and there is a comment explaining why.

I see a lot of calls to request_region in __init calls. For example there is a call in netwinder-hw.c:wb977_init. Should they be checking for the return value ?

#3 lore raw
In reply to Vivek Subbarao
Quoted 8 lines · Vivek Subbarao
Quoted 7 lines · Dan Carpenter
Quoted 3 lines · Vivek Subbarao

There are many places where the return value from request_region is not checked for null value. This is required right ? I am just checking before I can send patched fixing them

Most of the time, but not always.

Quoted 7 lines
Quoted 4 lines

Sometimes people know it will succeed. The first one I looked at in drivers/acpi/acpi_processor.c the caller doesn't care if it succeeds and there is a comment explaining why.

I see a lot of calls to request_region in __init calls. For example there is a call in netwinder-hw.c:wb977_init. Should they be checking for the return value ?

This is a very well defined specific hardware and they know it won't fail or if it were to fail then the system couldn't boot anyway so returning an error code doesn't do any good.

regards,
dan carpenter