Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738246

[PATCH 1/4] [media] omap3isp: Delete an error message for a failed memory allocation in three functions

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 1/4] [media] omap3isp: Delete an error message for a failed memory allocation in three functions
Date 2017-09-24 20:10 +0200
Message-ID <utjvQ-3xk-19@gated-at.bofh.it> (permalink)
References <utjvQ-3xk-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 24 Sep 2017 18:25:44 +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@users.sourceforge.net>
---
 drivers/media/platform/omap3isp/isp.c         | 4 +---
 drivers/media/platform/omap3isp/isph3a_aewb.c | 5 +----
 drivers/media/platform/omap3isp/isph3a_af.c   | 5 +----
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 1a428fe9f070..874b883ac83a 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2236,10 +2236,8 @@ static int isp_probe(struct platform_device *pdev)
 	int i, m;
 
 	isp = devm_kzalloc(&pdev->dev, sizeof(*isp), GFP_KERNEL);
-	if (!isp) {
-		dev_err(&pdev->dev, "could not allocate memory\n");
+	if (!isp)
 		return -ENOMEM;
-	}
 
 	ret = fwnode_property_read_u32(of_fwnode_handle(pdev->dev.of_node),
 				       "ti,phy-type", &isp->phy_type);
diff --git a/drivers/media/platform/omap3isp/isph3a_aewb.c b/drivers/media/platform/omap3isp/isph3a_aewb.c
index d44626f20ac6..9844b9d06634 100644
--- a/drivers/media/platform/omap3isp/isph3a_aewb.c
+++ b/drivers/media/platform/omap3isp/isph3a_aewb.c
@@ -303,11 +303,8 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp)
 	/* Set recover state configuration */
 	aewb_recover_cfg = devm_kzalloc(isp->dev, sizeof(*aewb_recover_cfg),
 					GFP_KERNEL);
-	if (!aewb_recover_cfg) {
-		dev_err(aewb->isp->dev,
-			"AEWB: cannot allocate memory for recover configuration.\n");
+	if (!aewb_recover_cfg)
 		return -ENOMEM;
-	}
 
 	aewb_recover_cfg->saturation_limit = OMAP3ISP_AEWB_MAX_SATURATION_LIM;
 	aewb_recover_cfg->win_height = OMAP3ISP_AEWB_MIN_WIN_H;
diff --git a/drivers/media/platform/omap3isp/isph3a_af.c b/drivers/media/platform/omap3isp/isph3a_af.c
index 99bd6cc21d86..b81e869ade8c 100644
--- a/drivers/media/platform/omap3isp/isph3a_af.c
+++ b/drivers/media/platform/omap3isp/isph3a_af.c
@@ -366,11 +366,8 @@ int omap3isp_h3a_af_init(struct isp_device *isp)
 	/* Set recover state configuration */
 	af_recover_cfg = devm_kzalloc(isp->dev, sizeof(*af_recover_cfg),
 				      GFP_KERNEL);
-	if (!af_recover_cfg) {
-		dev_err(af->isp->dev,
-			"AF: cannot allocate memory for recover configuration.\n");
+	if (!af_recover_cfg)
 		return -ENOMEM;
-	}
 
 	af_recover_cfg->paxel.h_start = OMAP3ISP_AF_PAXEL_HZSTART_MIN;
 	af_recover_cfg->paxel.width = OMAP3ISP_AF_PAXEL_WIDTH_MIN;
-- 
2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] [media] OMAP3 ISP: Adjustments for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-24 20:10 +0200
  [PATCH 3/4] [media] omap3isp: Use common error handling code in  isp_video_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-24 20:10 +0200
  [PATCH 4/4] [media] omap3isp: Delete an unnecessary variable  initialisation in isp_video_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-24 20:10 +0200
  [PATCH 2/4] [media] omap3isp: Adjust 53 checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-24 20:10 +0200
  [PATCH 1/4] [media] omap3isp: Delete an error message for a failed  memory allocation in three functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-24 20:10 +0200

csiph-web