From patchwork Mon Apr 27 11:05:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 26495 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 753BAB7067 for ; Mon, 27 Apr 2009 21:05:54 +1000 (EST) Received: by ozlabs.org (Postfix) id 664CCDDE26; Mon, 27 Apr 2009 21:05:54 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id E9A8CDDE25 for ; Mon, 27 Apr 2009 21:05:53 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756024AbZD0LFe (ORCPT ); Mon, 27 Apr 2009 07:05:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755421AbZD0LFc (ORCPT ); Mon, 27 Apr 2009 07:05:32 -0400 Received: from ey-out-2122.google.com ([74.125.78.24]:45810 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754553AbZD0LFb (ORCPT ); Mon, 27 Apr 2009 07:05:31 -0400 Received: by ey-out-2122.google.com with SMTP id 9so542049eyd.37 for ; Mon, 27 Apr 2009 04:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=858S7pfM03yM8uGFyIw3J52Q208+N4AmI3PLTexrfUM=; b=Ac8zEMDqGenDLi6NcMFkiwY84REsyIqEAG6iSG4USbQ/QyM8jH4RKjgpPabxFjs0Yi 0z4uwE3Puf5WgiPC9kbQPbDT5cChNl76eXtZm95BoxlwYZdVTpGfL+HmggUrQKdrM1Po k2DhapRgaheQtMZyapT3PVeFYqOpR/tjWwc70= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Ggp/j9WAN6n0tcz3alucNcqpBNPzmaZ3y4hbQ74o9nmRp6dERszEoTZxtc0n+6TDEw leb/TCQ1wma/3UJ1HMvj3usULAeMBsMTP+tsmtrairXUhvQrJdFbEXqN2zVYYncuVk6b arJgffYBwvaEFPnUZmSSO32YoVNjxtla5huuQ= Received: by 10.210.57.12 with SMTP id f12mr4596520eba.84.1240830330257; Mon, 27 Apr 2009 04:05:30 -0700 (PDT) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 5sm1653552eyf.14.2009.04.27.04.05.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Apr 2009 04:05:29 -0700 (PDT) Message-ID: <49F5917A.3060909@gmail.com> Date: Mon, 27 Apr 2009 13:05:30 +0200 From: Roel Kluin User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: David Miller CC: netdev@vger.kernel.org, Andrew Morton Subject: [PATCH 2/2] gianfar: irq_of_parse_and_map() error unnoticed References: <49F0649C.8030908@gmail.com> <20090427.031116.43598009.davem@davemloft.net> In-Reply-To: <20090427.031116.43598009.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org priv->interruptTransmit, -Receive and -Error are unsigned, so the error path wasn't taken when irq_of_parse_and_map() returned an incorrect irq. Signed-off-by: Roel Kluin --- -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/net/gianfar.c b/drivers/net/gianfar.c index b2c4967..55c2ce8 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -203,9 +203,9 @@ static int gfar_of_init(struct net_device *dev) priv->interruptError = irq_of_parse_and_map(np, 2); - if (priv->interruptTransmit < 0 || - priv->interruptReceive < 0 || - priv->interruptError < 0) { + if (priv->interruptTransmit == NO_IRQ || + priv->interruptReceive == NO_IRQ || + priv->interruptError == NO_IRQ) { err = -EINVAL; goto err_out; }