[PATCH] ide:ide-cd: use q->initialize_rq_fn() to replace explicitly calling scsi_req_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



- memset(req->cmd, 0, BLK_MAX_CDB) is called once instead of twice.

- The sense buffer pointer gets initialized.

Fixes: 79d73346ac05 ("ide:ide-cd: fix kernel panic resulting from missing scsi_req_init")
Suggested-by: Bart Van Assche <Bart.VanAssche@xxxxxxx>
Signed-off-by: Hongxu Jia <hongxu.jia@xxxxxxxxxxxxx>
---
 drivers/ide/ide-cd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index a7355ab..09b5bdb 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1328,8 +1328,7 @@ static int ide_cdrom_prep_fs(struct request_queue *q, struct request *rq)
 	unsigned long blocks = blk_rq_sectors(rq) / (hard_sect >> 9);
 	struct scsi_request *req = scsi_req(rq);
 
-	scsi_req_init(req);
-	memset(req->cmd, 0, BLK_MAX_CDB);
+	q->initialize_rq_fn(rq);
 
 	if (rq_data_dir(rq) == READ)
 		req->cmd[0] = GPCMD_READ_10;
-- 
2.7.4




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux