mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
sx.c: avoid referencing freed memory if copy_from_user() fails
The "break" would just result in reusing a free'd pointer. I don't have the cards myself to test it though. :/ Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
9b6d25100a
commit
b28fe28f2a
@ -1789,7 +1789,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
|
||||
nbytes - i : SX_CHUNK_SIZE)) {
|
||||
kfree(tmp);
|
||||
rc = -EFAULT;
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
memcpy_toio(board->base2 + offset + i, tmp,
|
||||
(i + SX_CHUNK_SIZE > nbytes) ?
|
||||
|
Loading…
Reference in New Issue
Block a user