Skip to content

Commit 7dcef39

Browse files
Dan Carpenterandersson
authored andcommitted
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 <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Fixes: 305ac5a ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20200520120705.GH172354@mwanda Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 1ec5dbe commit 7dcef39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/remoteproc/remoteproc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,7 @@ struct rproc *devm_rproc_alloc(struct device *dev, const char *name,
22972297

22982298
ptr = devres_alloc(devm_rproc_free, sizeof(*ptr), GFP_KERNEL);
22992299
if (!ptr)
2300-
return ERR_PTR(-ENOMEM);
2300+
return NULL;
23012301

23022302
rproc = rproc_alloc(dev, name, ops, firmware, len);
23032303
if (rproc) {

0 commit comments

Comments
 (0)