From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ea0-f182.google.com ([209.85.215.182]:39884 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbaBOMmd (ORCPT ); Sat, 15 Feb 2014 07:42:33 -0500 From: Levente Kurusa To: Greg Kroah-Hartman , Mauro Carvalho Chehab Cc: LKML , OSUOSL Drivers , Linux Media , Josh Triplett , Lisa Nguyen , Archana kumari , David Binderman , Levente Kurusa Subject: [PATCH] staging: davinci_vpfe: fix error check Date: Sat, 15 Feb 2014 11:17:11 +0100 Message-Id: <1392459431-28203-1-git-send-email-levex@linux.com> Sender: linux-media-owner@vger.kernel.org List-ID: The check would check the pointer, which is never less than 0. According to the error message, the correct check would be to check the return value of ipipe_mode. Check that instead. Reported-by: David Binderman Signed-off-by: Levente Kurusa --- drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index 2d36b60..b2daf5e 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c @@ -267,7 +267,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe) } ipipe_mode = get_ipipe_mode(ipipe); - if (ipipe < 0) { + if (ipipe_mode < 0) { pr_err("Failed to get ipipe mode"); return -EINVAL; } -- 1.8.3.1