From: Dan Carpenter Date: Wed, 20 May 2020 12:07:05 +0000 (+0300) Subject: remoteproc: Fix an error code in devm_rproc_alloc() X-Git-Tag: v5.15~3644^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dcef3988eedbfb40e7e95a821966a029a5a465b;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Bjorn Andersson Fixes: 305ac5a766b1 ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200520120705.GH172354@mwanda Signed-off-by: Bjorn Andersson --- diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 0cc015f..9f04c30 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2297,7 +2297,7 @@ struct rproc *devm_rproc_alloc(struct device *dev, const char *name, ptr = devres_alloc(devm_rproc_free, sizeof(*ptr), GFP_KERNEL); if (!ptr) - return ERR_PTR(-ENOMEM); + return NULL; rproc = rproc_alloc(dev, name, ops, firmware, len); if (rproc) {