[PATCH] blk: All obtained blk requests should be put after all

From: Marina Makienko
Date: Wed Aug 08 2012 - 08:47:25 EST


blk requests are obtained (some memory is allocated for them) by means of functions blk_get_request and blk_make_request. After usage (usually with help of blk_execute_rq) these requests should be put (and freed) with help of blk_put_request.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Marina Makienko <makienko@xxxxxxxxx>
---
drivers/block/paride/pd.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 831e3ac..528a9a5 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -723,6 +723,11 @@ static int pd_special_command(struct pd_unit *disk,

rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT);

+ if (!rq) {
+ sdev_printk(KERN_INFO, sdev, "get_req: blk_get_request failed");
+ return NULL;
+ }
+
rq->cmd_type = REQ_TYPE_SPECIAL;
rq->special = func;

--
1.7.7

--
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/