Re: [PATCH] dvb: return -ENOMEM if kzalloc failed in dvb_usb_device_init()

From: roel kluin
Date: Wed Feb 03 2010 - 11:03:17 EST


On Tue, Feb 2, 2010 at 3:29 PM, Oliver Neukum <oliver@xxxxxxxxxx> wrote:
> Am Dienstag, 2. Februar 2010 15:29:46 schrieb Roel Kluin:
>> If in a cold state and the download succeeded ret is zero, but we
>> should return -ENOMEM.
>>
>> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
>> ---
>> Or shouldn't we?
>
> We should and we do if cold==0.
> The bug is caused by this:
>
> Â Â Â Âif (cold) {
> Â Â Â Â Â Â Â Âinfo("found a '%s' in cold state, will try to load a firmware",desc->name);
> Â Â Â Â Â Â Â Âret = dvb_usb_download_firmware(udev,props);
> Â Â Â Â Â Â Â Âif (!props->no_reconnect || ret != 0)
> Â Â Â Â Â Â Â Â Â Â Â Âreturn ret;
> Â Â Â Â}
>
> which overwrites ret

Is that an ack or do you want me to add an int (e.g. rc) that
handles the dvb_usb_download_firmware() return value?

Roel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/