forked from Minki/linux
USB: qcserial: fix a memory leak in qcprobe error path
This patch adds missing kfree(data) before return -ENODEV. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
10ca442571
commit
0d152de569
@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
|
||||
"Could not set interface, error %d\n",
|
||||
retval);
|
||||
retval = -ENODEV;
|
||||
kfree(data);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
|
||||
"Could not set interface, error %d\n",
|
||||
retval);
|
||||
retval = -ENODEV;
|
||||
kfree(data);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
|
||||
default:
|
||||
dev_err(&serial->dev->dev,
|
||||
"unknown number of interfaces: %d\n", nintf);
|
||||
kfree(data);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user