Commit efee0bd9 authored by Jesper Juhl's avatar Jesper Juhl Committed by James Bottomley

[SCSI] mptfusion: Fix memory leak in mptctl_getiocinfo()

A 'kfree(karg)' is missing in a failure path in
mptctl.c::mptctl_getiocinfo() which can cause a memory leak.
Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Acked-by: default avatar"Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 70e14722
...@@ -1307,8 +1307,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) ...@@ -1307,8 +1307,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
else else
karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
if (karg->hdr.port > 1) if (karg->hdr.port > 1) {
kfree(karg);
return -EINVAL; return -EINVAL;
}
port = karg->hdr.port; port = karg->hdr.port;
karg->port = port; karg->port = port;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment