Re: [PATCH] [PATCH] staging: rtl8723bs: change error handling to use standard errno

From: Omer

Date: Fri Mar 20 2026 - 04:48:08 EST


thank you for replying.

I've now read the sdio_dvobj_init source code and realized it also returns NULL
after non-malloc related problems so i'm going to change it from -ENOMEM to
-ENODEV.

Apologies for the double [PATCH] prefix, it was unintentionally put there.

best,

Omer El Idrissi


On Fri, Mar 20, 2026 at 9:43 AM Omer <omer.e.idrissi@xxxxxxxxx> wrote:
>
> thank you for replying.
>
> On Fri, Mar 20, 2026 at 8:36 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>>
>> On Fri, Mar 20, 2026 at 08:29:50AM +0100, Omer El Idrissi wrote:
>> > Replace non-standard return values with descriptive
>> > linux kernel error codes in probe path.
>> > Also replace the variable name 'status' with 'ret'
>> > to be more consistent with other kernel code
>> >
>> > Signed-off-by: Omer El Idrissi <omer.e.idrissi@xxxxxxxxx>
>> > ---
>> > drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 30 +++++++++++++-------
>> > 1 file changed, 19 insertions(+), 11 deletions(-)
>> >
>> > diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
>> > index d664e254912c..ff0ebcb59c68 100644
>> > --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
>> > +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
>> > @@ -345,38 +345,46 @@ static int rtw_drv_init(
>> > struct sdio_func *func,
>> > const struct sdio_device_id *id)
>> > {
>> > - int status = _FAIL;
>> > + int ret;
>> > struct adapter *if1 = NULL;
>> > struct dvobj_priv *dvobj;
>> >
>> > dvobj = sdio_dvobj_init(func);
>> > - if (!dvobj)
>> > + if (!dvobj) {
>> > + ret = -ENOMEM;
>>
>> why is this an "out of memory" error?
>>
>> thanks,
>>
>> greg k-h
>
>
> I've now read the sdio_dvobj_init source code and realized it also returns NULL
> after non-malloc related problems so i'm going to change it from -ENOMEM to
> -ENODEV.
>
> Apologies for the double [PATCH] prefix, I unintentionally put it there.
>
> best,
>
> Omer El Idrissi