Searched hist:"5854809 b51f4e3868202d9b45e628133d76b48cd" (Results 1 – 1 of 1) sorted by relevance
/linux/drivers/misc/ |
H A D | rpmb-core.c | diff 5854809b51f4e3868202d9b45e628133d76b48cd Mon Sep 02 12:58:03 CEST 2024 Jens Wiklander <jens.wiklander@linaro.org> rpmb: fix error path in rpmb_dev_register()
Until this patch was rpmb_dev_register() always freeing rdev in the error path. However, past device_register() it must not do that since the memory is now managed by the device even if it failed to register properly. So fix this by doing a put_device() before returning the error code.
Fixes the smatch warning: drivers/misc/rpmb-core.c:204 rpmb_dev_register() warn: freeing device managed memory (leak): 'rdev'
Fixes: 1e9046e3a154 ("rpmb: add Replay Protected Memory Block (RPMB) subsystem") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Link: https://lore.kernel.org/r/20240902105803.2885544-1-jens.wiklander@linaro.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
|