Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ims-pcu - fix a memory leak on error

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+3 -2
+3 -2
drivers/input/misc/ims-pcu.c
··· 292 292 if (!gamepad || !input) { 293 293 dev_err(pcu->dev, 294 294 "Not enough memory for gamepad device\n"); 295 - return -ENOMEM; 295 + error = -ENOMEM; 296 + goto err_free_mem; 296 297 } 297 298 298 299 gamepad->input = input; ··· 1157 1156 { 1158 1157 struct usb_interface *intf = to_usb_interface(dev); 1159 1158 struct ims_pcu *pcu = usb_get_intfdata(intf); 1160 - const struct firmware *fw; 1159 + const struct firmware *fw = NULL; 1161 1160 int value; 1162 1161 int error; 1163 1162