Merge tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6
Pull misc fixes from David Woodhouse: "This is some miscellaneous cleanups that don't really belong anywhere else (or were ignored), that have been sitting in linux-next for some time. Two of them are fixes resulting from my audit of krealloc() usage that don't seem to have elicited any response when I posted them, and the other three are patches from Artem removing dead code." * tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6: pcmcia: remove RPX board stuff m68k: remove rpxlite stuff pcmcia: remove Motorola MBX860 support params: Fix potential memory leak in add_sysfs_param() dell-laptop: Fix krealloc() misuse in parse_da_table()
This commit is contained in:
+4
-1
@@ -613,10 +613,13 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
|
||||
sizeof(*mk->mp) + sizeof(mk->mp->attrs[0]) * (num+1),
|
||||
GFP_KERNEL);
|
||||
if (!new) {
|
||||
kfree(mk->mp);
|
||||
kfree(attrs);
|
||||
err = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
/* Despite looking like the typical realloc() bug, this is safe.
|
||||
* We *want* the old 'attrs' to be freed either way, and we'll store
|
||||
* the new one in the success case. */
|
||||
attrs = krealloc(attrs, sizeof(new->grp.attrs[0])*(num+2), GFP_KERNEL);
|
||||
if (!attrs) {
|
||||
err = -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user