From patchwork Tue Sep 4 12:05:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1401931 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 84B933FC71 for ; Tue, 4 Sep 2012 12:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756852Ab2IDMFr (ORCPT ); Tue, 4 Sep 2012 08:05:47 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:40440 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756869Ab2IDMF2 (ORCPT ); Tue, 4 Sep 2012 08:05:28 -0400 Received: by weyx8 with SMTP id x8so3457348wey.19 for ; Tue, 04 Sep 2012 05:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=IlBeY/P0mie6gvwTAfjreWxOv0VVXC9HcEAOG53VX0Q=; b=GeX7WLwFiw8BxJIlunQwsqQasqoN/IcpHM1G+qXfXweKgPDXq5hJM+jfmdlt0PeDQo 1U4hd2cXdH1ibvvZwA9BOuyG7wt8hvdokQtFc9s7Hu2AzwaxbKrL+EMzEdhViR7XQjz9 C8atzoABXEN9yvSYEWdLDlJRJOTjT9aklqn/f8vl0IaMiSG2TutsBFo8Vq6bTeDiAsnj zb7rn7xYJ05XcOKoFohKKut7cuaYhQz4GvjvrLUtib0jalGdZzzWfmLeVurAqfG20lBm JNWVUfx3XKeZv0BAFRv6n93g+azBVMQdX3uJTGYTMjWDuh1CuXEh3o/9PqD1RtOT7DXa mutA== Received: by 10.180.107.103 with SMTP id hb7mr30394617wib.3.1346760326714; Tue, 04 Sep 2012 05:05:26 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id fp3sm24128310wib.7.2012.09.04.05.05.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 05:05:26 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] drivers/media/rc/redrat3.c: fix error return code Date: Tue, 4 Sep 2012 14:05:05 +0200 Message-Id: <1346760305-13060-3-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/media/rc/redrat3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 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/rc/redrat3.c b/drivers/media/rc/redrat3.c index 2878b0e..49731b1 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -1217,9 +1217,10 @@ static int __devinit redrat3_dev_probe(struct usb_interface *intf, rr3->carrier = 38000; rr3->rc = redrat3_init_rc_dev(rr3); - if (!rr3->rc) + if (!rr3->rc) { + retval = -ENOMEM; goto error; - + } setup_timer(&rr3->rx_timeout, redrat3_rx_timeout, (unsigned long)rr3); /* we can register the device now, as it is ready */