diff options
author | Elias Oltmanns <eo@nebensachen.de> | 2008-10-13 15:39:45 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:45 -0400 |
commit | e415e495f8294e536e09e6a15fba897cce4c0748 (patch) | |
tree | 7a1a9c82d1b0faedf2454a76027df6e1fff4a8fb /drivers/ide/ide-io.c | |
parent | 06b89518fa69fb7243dc98c31f9a9cfa61bfe788 (diff) |
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 <eo@nebensachen.de>
[bart: remove superfluous ide_lock taking]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index d0579f1abddd..e205f46c3c7a 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, | |||
655 | if (!(setting->flags & DS_SYNC)) | 655 | if (!(setting->flags & DS_SYNC)) |
656 | return setting->set(drive, arg); | 656 | return setting->set(drive, arg); |
657 | 657 | ||
658 | rq = blk_get_request(q, READ, GFP_KERNEL); | 658 | rq = blk_get_request(q, READ, __GFP_WAIT); |
659 | if (!rq) | ||
660 | return -ENOMEM; | ||
661 | |||
662 | rq->cmd_type = REQ_TYPE_SPECIAL; | 659 | rq->cmd_type = REQ_TYPE_SPECIAL; |
663 | rq->cmd_len = 5; | 660 | rq->cmd_len = 5; |
664 | rq->cmd[0] = REQ_DEVSET_EXEC; | 661 | rq->cmd[0] = REQ_DEVSET_EXEC; |