mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drivers/block/paride/pg.c: underflow bug in pg_write()
The test here can underflow so we pass bogus lengths to the hardware. It's a static checker fix and I don't know the impact. Signed-off-by: Dan Carpenter <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
f2fc8af41c
commit
3f7d758b1e
1 changed files with 1 additions and 1 deletions
|
|
@ -581,7 +581,7 @@ static ssize_t pg_write(struct file *filp, const char __user *buf, size_t count,
|
|||
|
||||
if (hdr.magic != PG_MAGIC)
|
||||
return -EINVAL;
|
||||
if (hdr.dlen > PG_MAX_DATA)
|
||||
if (hdr.dlen < 0 || hdr.dlen > PG_MAX_DATA)
|
||||
return -EINVAL;
|
||||
if ((count - hs) > PG_MAX_DATA)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue