diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-11-21 04:06:57 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-21 04:43:52 -0500 |
commit | 27b2a22c714303d1920e269a8322ff23107694ee (patch) | |
tree | 76f06bcdd9975d8223e23a075ad3a697b8e5441d /sound/usb/6fire | |
parent | 6cf95152079d7c6d7ba6442be45e02b24bbb1c65 (diff) |
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 <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/6fire')
-rw-r--r-- | sound/usb/6fire/comm.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
129 | { | 129 | { |
130 | struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime), | 130 | struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime), |
131 | GFP_KERNEL); | 131 | GFP_KERNEL); |
132 | struct urb *urb = &rt->receiver; | 132 | struct urb *urb; |
133 | int ret; | 133 | int ret; |
134 | 134 | ||
135 | if (!rt) | 135 | if (!rt) |
136 | return -ENOMEM; | 136 | return -ENOMEM; |
137 | 137 | ||
138 | urb = &rt->receiver; | ||
138 | rt->serial = 1; | 139 | rt->serial = 1; |
139 | rt->chip = chip; | 140 | rt->chip = chip; |
140 | usb_init_urb(urb); | 141 | usb_init_urb(urb); |