projects
/
platform
/
kernel
/
linux-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b37c7d
)
aoe: fix use after free in aoedev_by_aoeaddr()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 18 Dec 2012 00:04:21 +0000
(16:04 -0800)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Tue, 18 Dec 2012 01:15:26 +0000
(17:15 -0800)
We should return NULL on failure instead of returning a freed pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/aoe/aoedev.c
patch
|
blob
|
history
diff --git
a/drivers/block/aoe/aoedev.c
b/drivers/block/aoe/aoedev.c
index
e66ccbf
..
98f2965
100644
(file)
--- a/
drivers/block/aoe/aoedev.c
+++ b/
drivers/block/aoe/aoedev.c
@@
-461,6
+461,7
@@
aoedev_by_aoeaddr(ulong maj, int min, int do_alloc)
d->targets = kcalloc(NTARGETS, sizeof(*d->targets), GFP_ATOMIC);
if (!d->targets) {
kfree(d);
+ d = NULL;
goto out;
}
d->ntargets = NTARGETS;