From patchwork Mon Jul 27 16:13:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 37581 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6RGMUg0003612 for ; Mon, 27 Jul 2009 16:22:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753204AbZG0QTR (ORCPT ); Mon, 27 Jul 2009 12:19:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752038AbZG0QTQ (ORCPT ); Mon, 27 Jul 2009 12:19:16 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:49100 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbZG0QTN (ORCPT ); Mon, 27 Jul 2009 12:19:13 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 479AD52C59C; Mon, 27 Jul 2009 18:19:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xfjKXCyLQOsA; Mon, 27 Jul 2009 18:19:11 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id B446052C46B; Mon, 27 Jul 2009 18:13:48 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 21C1F6DFB46; Mon, 27 Jul 2009 18:13:05 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id 9470A154D01; Mon, 27 Jul 2009 18:13:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 92FDD1547DF; Mon, 27 Jul 2009 18:13:48 +0200 (CEST) Date: Mon, 27 Jul 2009 18:13:48 +0200 (CEST) From: Julia Lawall To: kyle@mcmartin.ca, deller@gmx.de, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 5/12] drivers/parisc: Correct redundant test Message-ID: MIME-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org From: Julia Lawall pa_pdc_cell has already been tested. It seems that this test should be on the recently returned value io_pdc_cell. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; expression E; @@ if (x == NULL || ...) { ... when forall return ...; } ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\) ( *x == NULL | *x != NULL ) // Signed-off-by: Julia Lawall Reviewed-by: Grant Grundler --- drivers/parisc/lba_pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" 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/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index ede6146..3aeb327 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -992,7 +992,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) return; io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); - if (!pa_pdc_cell) { + if (!io_pdc_cell) { kfree(pa_pdc_cell); return; }