Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27b2a22c authored by Sachin Kamat's avatar Sachin Kamat Committed by Takashi Iwai
Browse files

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6cf95152
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);