From: Sachin Kamat Date: Wed, 21 Nov 2012 09:06:57 +0000 (+0530) Subject: ALSA: usb/6fire: Fix potential NULL pointer dereference in comm.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=27b2a22c714303d1920e269a8322ff23107694ee;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ALSA: usb/6fire: Fix potential NULL pointer dereference in comm.c 'rt' was dereferenced before the NULL check. Moved the code after the check. Signed-off-by: Sachin Kamat Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/6fire/comm.c b/sound/usb/6fire/comm.c index 6c3d531a250e..1a75c36932d8 100644 --- a/sound/usb/6fire/comm.c +++ b/sound/usb/6fire/comm.c @@ -129,12 +129,13 @@ int __devinit usb6fire_comm_init(struct sfire_chip *chip) { struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime), GFP_KERNEL); - struct urb *urb = &rt->receiver; + struct urb *urb; int ret; if (!rt) return -ENOMEM; + urb = &rt->receiver; rt->serial = 1; rt->chip = chip; usb_init_urb(urb);