]> git.baikalelectronics.ru Git - kernel.git/commit
devres: restore zeroing behavior of devres_alloc()
authorKevin Hilman <khilman@linaro.org>
Sat, 19 Oct 2013 05:52:46 +0000 (22:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Oct 2013 04:46:27 +0000 (05:46 +0100)
commit4338f4e512aab41d15de75ac88e548cef6acb5c2
treec50528bd6b06e8fbf47e0b95d1418e240cf30ca0
parentdbbc83f684ecbb0bb48684984f00015a64bd73db
devres: restore zeroing behavior of devres_alloc()

commit 5c921a3d (devres: add kernel standard devm_k.alloc functions) changed
the default behavior of alloc_dr() to no longer zero the allocated memory.  However,
only the devm.k.alloc() function were modified to pass in __GFP_ZERO which leaves
any users of devres_alloc() or __devres_alloc() with potentially wrong assumptions
about memory being zero'd upon allocation.

To fix, add __GFP_ZERO to devres_alloc() calls to preserve previous
behavior of zero'ing memory upon allocation.

Signed-off-by: Kevin Hilman <khilman@linaro.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devres.c