Skip to content

Commit

Permalink
USB: qcserial: fix a memory leak in qcprobe error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Greg Kroah-Hartman committed Jun 30, 2010
1 parent 10ca442 commit 0d152de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/serial/qcserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}

Expand Down

0 comments on commit 0d152de

Please sign in to comment.