dvb-usb: gp8psk, fix potential null derefernce
PATCH 3/11 dvb-usb: gp8psk, fix potential null derefernce
From: Jiri Slaby <[email protected]>
Stanse found that in gp8psk_load_bcm4500fw there is missing a check for return value of kmalloc. Add one and bail out appropriatelly.
Signed-off-by Jiri Slaby <[email protected]>
Cc Alan Nisota <[email protected]>
Cc Patrick Boettcher <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/media/dvb/dvb-usb/gp8psk.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/media/dvb/dvb-usb/gp8psk.c renamed from drivers/media/dvb/dvb-usb/gp8psk.c~dvb-usb-gp8psk-fix-potential-null-derefernce +4 -0
@@ -105,6 +105,10 @@ static int gp8psk_load_bcm4500fw(struct ptr = fw->data; buf =kmalloc (64 ,GFP_KERNEL |GFP_DMA ); +if (!buf) { + ret = -ENOMEM ; + goto out_rel_fw; + }while (ptr[0 ] !=0xff ) {u16 buflen = ptr[0 ] +4 ;
_