From patchwork Thu Sep 6 15:23:55 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: 1415971 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 0985EDFFCF for ; Thu, 6 Sep 2012 15:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758236Ab2IFP01 (ORCPT ); Thu, 6 Sep 2012 11:26:27 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:49110 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755379Ab2IFPYR (ORCPT ); Thu, 6 Sep 2012 11:24:17 -0400 Received: by wgbdr13 with SMTP id dr13so1754180wgb.1 for ; Thu, 06 Sep 2012 08:24:16 -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=yUpLf55JGSuIIVhzIrdJ9rPmwSuELZQBQcL9yzTu8Tw=; b=uMP2e6bZXpnAK0Ir17TovvZFI5BALPZ4Y0c8yQmubjJZzv6uXEC79WL+kh1GJlNh2g FQ/lYXzSfb+iR0pQbnlrdnd7X6XjJHjZnadktqUV59BW4QY7vl8/yrV32462Zzte61um C9GLUs15ZYlHj6sy5HW1Hct409dIz4Syq57FB2DrmQ23al+Mm8nASUam/E/G13iCFlgw raI6J7vLrNjFMuPsDg4/NysA9SnBPdYyV0yxijpa9O6jgX+vpHLEopAHlKklX+Eesuwo L++tNGjqiyFdS8EvY7ugMKIw1h9MCEIBIImq010G4alV0Of3ZMjkPEUGZtct/5oTf7hl W+Zg== Received: by 10.180.106.97 with SMTP id gt1mr46535754wib.5.1346945056195; Thu, 06 Sep 2012 08:24:16 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id el6sm4572331wib.8.2012.09.06.08.24.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:24:15 -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 6/14] drivers/media/pci/dm1105/dm1105.c: fix error return code Date: Thu, 6 Sep 2012 17:23:55 +0200 Message-Id: <1346945041-26676-8-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/pci/dm1105/dm1105.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/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c index a609b3a..f147031 100644 --- a/drivers/media/pci/dm1105/dm1105.c +++ b/drivers/media/pci/dm1105/dm1105.c @@ -1128,8 +1128,10 @@ static int __devinit dm1105_probe(struct pci_dev *pdev, INIT_WORK(&dev->work, dm1105_dmx_buffer); sprintf(dev->wqn, "%s/%d", dvb_adapter->name, dvb_adapter->num); dev->wq = create_singlethread_workqueue(dev->wqn); - if (!dev->wq) + if (!dev->wq) { + ret = -ENOMEM; goto err_dvb_net; + } ret = request_irq(pdev->irq, dm1105_irq, IRQF_SHARED, DRIVER_NAME, dev);