Skip to content

Commit

Permalink
spi: potential memleak in spidev_ioctl
Browse files Browse the repository at this point in the history
'ioc' should be deallocated if __copy_from_user fails (found by Coverity
- CID 1644).

Signed-off-by: Florin Malita <[email protected]>
Signed-off-by: David Brownell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fmalita authored and Linus Torvalds committed May 24, 2007
1 parent 6087b2d commit 9bea3f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/spi/spidev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9bea3f2

Please sign in to comment.