From patchwork Sat Aug 18 21:25:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 1341661 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 94B5ADF266 for ; Sat, 18 Aug 2012 21:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753895Ab2HRV1e (ORCPT ); Sat, 18 Aug 2012 17:27:34 -0400 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:61457 "EHLO mail1-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753334Ab2HRV0X (ORCPT ); Sat, 18 Aug 2012 17:26:23 -0400 X-IronPort-AV: E=Sophos;i="4.77,791,1336341600"; d="scan'208";a="170194857" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Aug 2012 23:26:06 +0200 From: Julia Lawall To: Kyungmin Park Cc: kernel-janitors@vger.kernel.org, Heungjun Kim , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] drivers/media/video/m5mols/m5mols_core.c: introduce missing initialization Date: Sat, 18 Aug 2012 23:25:59 +0200 Message-Id: <1345325159-7365-5-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.7.8.6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Julia Lawall The result of one call to a function is tested, and then at the second call to the same function, the previous result, and not the current result, is tested again. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression ret; identifier f; statement S1,S2; @@ *ret = f(...); if (\(ret != 0\|ret < 0\|ret == NULL\)) S1 ... when any *f(...); if (\(ret != 0\|ret < 0\|ret == NULL\)) S2 // Signed-off-by: Julia Lawall --- drivers/media/video/m5mols/m5mols_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/m5mols/m5mols_core.c b/drivers/media/video/m5mols/m5mols_core.c index ac7d28b..0f521f5 100644 --- a/drivers/media/video/m5mols/m5mols_core.c +++ b/drivers/media/video/m5mols/m5mols_core.c @@ -937,7 +937,7 @@ static int __devinit m5mols_probe(struct i2c_client *client, if (!ret) ret = m5mols_init_controls(sd); - m5mols_sensor_power(info, false); + ret = m5mols_sensor_power(info, false); if (!ret) return 0; out_me: