'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>
{
struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime),
GFP_KERNEL);
{
struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime),
GFP_KERNEL);
- struct urb *urb = &rt->receiver;
int ret;
if (!rt)
return -ENOMEM;
int ret;
if (!rt)
return -ENOMEM;
rt->serial = 1;
rt->chip = chip;
usb_init_urb(urb);
rt->serial = 1;
rt->chip = chip;
usb_init_urb(urb);