From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> Date: Fri, 15 Sep 2017 18:38:25 +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/stm32/stm32-dcmi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 35ba6f211b79..df12d10bd230 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -1374,6 +1374,4 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi) GFP_KERNEL); - if (!dcmi->sd_formats) { - dev_err(dcmi->dev, "Could not allocate memory\n"); + if (!dcmi->sd_formats) return -ENOMEM; - } @@ -1410,7 +1408,5 @@ static int dcmi_framesizes_init(struct stm32_dcmi *dcmi) GFP_KERNEL); - if (!dcmi->sd_framesizes) { - dev_err(dcmi->dev, "Could not allocate memory\n"); + if (!dcmi->sd_framesizes) return -ENOMEM; - } /* Fill array with sensor supported framesizes */ -- 2.14.1