Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

remoteproc: Fix an error code in devm_rproc_alloc()

The comments say that this function should return NULL on error and the
caller expects NULL returns as well so I have modified the code to match.
Returning an ERR_PTR(-ENOMEM) would lead to an OOps.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Fixes: 305ac5a766b1 ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200520120705.GH172354@mwanda
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

authored by

Dan Carpenter and committed by
Bjorn Andersson
7dcef398 1ec5dbef

+1 -1
+1 -1
drivers/remoteproc/remoteproc_core.c
··· 2297 2297 2298 2298 ptr = devres_alloc(devm_rproc_free, sizeof(*ptr), GFP_KERNEL); 2299 2299 if (!ptr) 2300 - return ERR_PTR(-ENOMEM); 2300 + return NULL; 2301 2301 2302 2302 rproc = rproc_alloc(dev, name, ops, firmware, len); 2303 2303 if (rproc) {