From: David Milburn Date: Wed, 12 Sep 2012 19:06:12 +0000 (-0500) Subject: mtip32xx: fix user_buffer check in exec_drive_command X-Git-Tag: upstream/snapshot3+hdmi~6682^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97651ea687d3b6a214c32b49f79523db709fba18;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mtip32xx: fix user_buffer check in exec_drive_command Current user_buffer check is incorrect and causes hdparm to fail # hdparm -I /dev/rssda HDIO_DRIVE_CMD(identify) failed: Input/output error /dev/rssda: Patching linux-3.6-rc5 hdparm works as expected # hdparm -I /dev/rssda /dev/rssda: ATA device, with non-removable media Model Number: DELL_P320h-MTFDGAL350SAH Serial Number: 00000000121302025F01 Firmware Revision: B1442808 Reported-by: Tomas Henzl Signed-off-by: David Milburn Signed-off-by: Jens Axboe --- diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index e6519e2..f946d31 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -1904,7 +1904,7 @@ static int exec_drive_command(struct mtip_port *port, u8 *command, int rv = 0, xfer_sz = command[3]; if (xfer_sz) { - if (user_buffer) + if (!user_buffer) return -EFAULT; buf = dmam_alloc_coherent(&port->dd->pdev->dev,