mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
spi: potential memleak in spidev_ioctl
'ioc' should be deallocated if __copy_from_user fails (found by Coverity - CID 1644). Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6087b2dab2
commit
9bea3f29fc
1 changed files with 1 additions and 0 deletions
|
@ -364,6 +364,7 @@ spidev_ioctl(struct inode *inode, struct file *filp,
|
|||
break;
|
||||
}
|
||||
if (__copy_from_user(ioc, (void __user *)arg, tmp)) {
|
||||
kfree(ioc);
|
||||
retval = -EFAULT;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue