re: mtip32xx:Added appropriate timeout value for secure erase

From: Dan Carpenter
Date: Fri Sep 28 2012 - 08:25:44 EST


Hello Selvan Mani,

The patch 75e152877069: "mtip32xx:Added appropriate timeout value for
secure erase" from Sep 27, 2012, leads to the following warning:
drivers/block/mtip32xx/mtip32xx.c:2222 exec_drive_taskfile()
error: potential NULL dereference 'outbuf'.

2220 /* check for erase mode support during secure erase.*/
2221 if ((fis.command == ATA_CMD_SEC_ERASE_UNIT)
2222 && (outbuf[0] & MTIP_SEC_ERASE_MODE)) {
^^^^^^
Smatch complains that if taskout is zero this is a NULL dereference.
Obviously that's not normal, but it looks like it might be possible.

2223 erasemode = 1;
2224 }

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/