From e415e495f8294e536e09e6a15fba897cce4c0748 Mon Sep 17 00:00:00 2001 From: Elias Oltmanns Date: Mon, 13 Oct 2008 21:39:45 +0200 Subject: ide: Two fixes regarding memory allocation In function ide_devset_execute() we should use __GFP_WAIT rather than GFP_KERNEL. Also, the allocation cannot possibly fail at that point. More importantly, there is a potential memory leak in the device probing code. The infrastructure seems rather complex and I hope I haven't messed anything up by trying to fix this. Signed-off-by: Elias Oltmanns [bart: remove superfluous ide_lock taking] Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-io.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/ide/ide-io.c') diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index d0579f1abdd..e205f46c3c7 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -655,10 +655,7 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting, if (!(setting->flags & DS_SYNC)) return setting->set(drive, arg); - rq = blk_get_request(q, READ, GFP_KERNEL); - if (!rq) - return -ENOMEM; - + rq = blk_get_request(q, READ, __GFP_WAIT); rq->cmd_type = REQ_TYPE_SPECIAL; rq->cmd_len = 5; rq->cmd[0] = REQ_DEVSET_EXEC; -- cgit v1.2.3-18-g5258