aboutsummaryrefslogtreecommitdiffstats
path: root/block/bsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 54106f052f70..5f184bb3ff9e 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -186,7 +186,7 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
186 return -EFAULT; 186 return -EFAULT;
187 187
188 if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) { 188 if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) {
189 if (blk_verify_command(&q->cmd_filter, rq->cmd, has_write_perm)) 189 if (blk_verify_command(rq->cmd, has_write_perm))
190 return -EPERM; 190 return -EPERM;
191 } else if (!capable(CAP_SYS_RAWIO)) 191 } else if (!capable(CAP_SYS_RAWIO))
192 return -EPERM; 192 return -EPERM;
@@ -315,7 +315,6 @@ out:
315 blk_put_request(rq); 315 blk_put_request(rq);
316 if (next_rq) { 316 if (next_rq) {
317 blk_rq_unmap_user(next_rq->bio); 317 blk_rq_unmap_user(next_rq->bio);
318 next_rq->bio = NULL;
319 blk_put_request(next_rq); 318 blk_put_request(next_rq);
320 } 319 }
321 return ERR_PTR(ret); 320 return ERR_PTR(ret);
@@ -449,7 +448,6 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
449 hdr->dout_resid = rq->resid_len; 448 hdr->dout_resid = rq->resid_len;
450 hdr->din_resid = rq->next_rq->resid_len; 449 hdr->din_resid = rq->next_rq->resid_len;
451 blk_rq_unmap_user(bidi_bio); 450 blk_rq_unmap_user(bidi_bio);
452 rq->next_rq->bio = NULL;
453 blk_put_request(rq->next_rq); 451 blk_put_request(rq->next_rq);
454 } else if (rq_data_dir(rq) == READ) 452 } else if (rq_data_dir(rq) == READ)
455 hdr->din_resid = rq->resid_len; 453 hdr->din_resid = rq->resid_len;
@@ -468,7 +466,6 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
468 blk_rq_unmap_user(bio); 466 blk_rq_unmap_user(bio);
469 if (rq->cmd != rq->__cmd) 467 if (rq->cmd != rq->__cmd)
470 kfree(rq->cmd); 468 kfree(rq->cmd);
471 rq->bio = NULL;
472 blk_put_request(rq); 469 blk_put_request(rq);
473 470
474 return ret; 471 return ret;