diff options
author | Selvan Mani <smani@micron.com> | 2012-11-07 14:03:37 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-11-23 14:32:54 +0100 |
commit | 3208795e612406df04a32b46eb5ea5fccfa51d69 (patch) | |
tree | 83ad3d3b6c1e0ede845623efdd838a11472f1e91 /drivers/block/mtip32xx | |
parent | dm: fix deadlock with request based dm and queue request_fn recursion (diff) | |
download | linux-3208795e612406df04a32b46eb5ea5fccfa51d69.tar.xz linux-3208795e612406df04a32b46eb5ea5fccfa51d69.zip |
mtip32xx: fix potential crash on SEC_ERASE_UNIT
The mtip driver lifted this code from elsewhere and then added a special
handling check for SEC_ERASE_UNIT. If the caller tries to do a security
erase but passes no output data for the command then outbuf is not
allocated and the driver duly explodes.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Selvan Mani <smani@micron.com>
Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/mtip32xx')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index adc6f36564cf..dfb7196bbde9 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2218,8 +2218,8 @@ static int exec_drive_taskfile(struct driver_data *dd, fis.device); /* check for erase mode support during secure erase.*/ - if ((fis.command == ATA_CMD_SEC_ERASE_UNIT) - && (outbuf[0] & MTIP_SEC_ERASE_MODE)) { + if ((fis.command == ATA_CMD_SEC_ERASE_UNIT) && outbuf && + (outbuf[0] & MTIP_SEC_ERASE_MODE)) { erasemode = 1; } |