From patchwork Tue Sep 4 12:05:04 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: 1401911 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 39A3DDFFD0 for ; Tue, 4 Sep 2012 12:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756898Ab2IDMF3 (ORCPT ); Tue, 4 Sep 2012 08:05:29 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:42891 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756818Ab2IDMF1 (ORCPT ); Tue, 4 Sep 2012 08:05:27 -0400 Received: by wibhq12 with SMTP id hq12so4180323wib.1 for ; Tue, 04 Sep 2012 05:05:25 -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=eaSZ+U8INbNOLeT9RZaDB8sbAIoCz3NHseINWktq8bg=; b=S1a6Rk8xh5pz6wEbXMheiFY205wc6VcWcUkTskMvGoltrQ2p7GQ8+xkuj2xyvFS1Ab bwL8xi7f9yWt4hs1aodZQIMH0cemh288VkyMZ2cG/+/tqsWQBt1zfqkbDyG0XpPadpQQ 1tTpClaygnGECLyO33US/8ODeJAqNkr32ztIPMjrlWQI7O0zXwXaRpJlpL9SVoiID7cn 4n8nFuWWK6c2pPEx/eotR0UQXFZdex5s7GBFtJmEaBmNTVj2PmAp8VY5ZraTzpIdQZv5 EY3zYwLX94/L7sEpSdgY5nz3ERb+6eEYIpZ5lW+6AIQ4Z1diYxPV0Lavd/I5gt4Fsy5o zupA== Received: by 10.181.13.208 with SMTP id fa16mr30347531wid.11.1346760325827; Tue, 04 Sep 2012 05:05:25 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id fp3sm24128310wib.7.2012.09.04.05.05.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 05:05:25 -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 2/3] drivers/media/rc/ati_remote.c: fix error return code Date: Tue, 4 Sep 2012 14:05:04 +0200 Message-Id: <1346760305-13060-2-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/ati_remote.c | 4 +++- 1 file changed, 3 insertions(+), 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/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 08aede5..49bb356 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -937,8 +937,10 @@ static int ati_remote_probe(struct usb_interface *interface, /* Set up and register mouse input device */ if (mouse) { input_dev = input_allocate_device(); - if (!input_dev) + if (!input_dev) { + err = -ENOMEM; goto fail4; + } ati_remote->idev = input_dev; ati_remote_input_init(ati_remote);