From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> Date: Fri, 15 Sep 2017 20:15:17 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> --- drivers/media/platform/ti-vpe/csc.c | 4 +--- drivers/media/platform/ti-vpe/sc.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/ti-vpe/csc.c b/drivers/media/platform/ti-vpe/csc.c index 44b8465cf101..135fc9993679 100644 --- a/drivers/media/platform/ti-vpe/csc.c +++ b/drivers/media/platform/ti-vpe/csc.c @@ -176,8 +176,6 @@ struct csc_data *csc_create(struct platform_device *pdev, const char *res_name) csc = devm_kzalloc(&pdev->dev, sizeof(*csc), GFP_KERNEL); - if (!csc) { - dev_err(&pdev->dev, "couldn't alloc csc_data\n"); + if (!csc) return ERR_PTR(-ENOMEM); - } csc->pdev = pdev; diff --git a/drivers/media/platform/ti-vpe/sc.c b/drivers/media/platform/ti-vpe/sc.c index e9273b713782..e9e307875feb 100644 --- a/drivers/media/platform/ti-vpe/sc.c +++ b/drivers/media/platform/ti-vpe/sc.c @@ -284,8 +284,6 @@ struct sc_data *sc_create(struct platform_device *pdev, const char *res_name) sc = devm_kzalloc(&pdev->dev, sizeof(*sc), GFP_KERNEL); - if (!sc) { - dev_err(&pdev->dev, "couldn't alloc sc_data\n"); + if (!sc) return ERR_PTR(-ENOMEM); - } sc->pdev = pdev; -- 2.14.1