Skip to content

Commit

Permalink
[SCSI] mptfusion: Fix memory leak in mptctl_getiocinfo()
Browse files Browse the repository at this point in the history
A 'kfree(karg)' is missing in a failure path in
mptctl.c::mptctl_getiocinfo() which can cause a memory leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Jesper Juhl authored and James Bottomley committed Jan 24, 2011
1 parent 70e1472 commit efee0bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/message/fusion/mptctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,8 +1307,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
else
karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;

if (karg->hdr.port > 1)
if (karg->hdr.port > 1) {
kfree(karg);
return -EINVAL;
}
port = karg->hdr.port;

karg->port = port;
Expand Down

0 comments on commit efee0bd

Please sign in to comment.