提交 97651ea6 编写于 作者: D David Milburn 提交者: Jens Axboe

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
<snip>
Reported-by: NTomas Henzl <thenzl@redhat.com>
Signed-off-by: NDavid Milburn <dmilburn@redhat.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 ac64e657
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册