From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Subject: Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet. Date: Tue, 07 Aug 2007 16:04:19 -0700 Message-ID: References: <1185957077.5552.22.camel@dell> <200708020006.13457.mb@bu3sch.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Michael Chan" , davem@davemloft.net, jeff@garzik.org, netdev@vger.kernel.org, eliezert@broadcom.com, lusinsky@broadcom.com, eilong@broadcom.com To: Michael Buesch Return-path: Received: from sj-iport-3-in.cisco.com ([171.71.176.72]:23183 "EHLO sj-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936676AbXHGXE1 (ORCPT ); Tue, 7 Aug 2007 19:04:27 -0400 In-Reply-To: <200708020006.13457.mb@bu3sch.de> (Michael Buesch's message of "Thu, 2 Aug 2007 00:06:12 +0200") Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org > > +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) > > +{ > > + struct net_device *dev = dev_instance; > > You need to check if dev==NULL and bail out. > Another driver sharing the IRQ with this might choose to pass the dev > pointer as NULL. I don't really understand this. If another driver is sharing the IRQ with a different device pointer (or even NULL), then that driver's handler is the one that would be called. It's certainly the case that an interrupt handler can be called for a shared interrupt generated by another device, but a driver will never get a cookie back into its interrupt handler different than the one it passed to request_irq(). A NULL check couldn't really help anything -- because if one driver's dev_id can get passed into another driver's interrupt handler, the non-NULL case would be even worse, because you would have one driver poking into another driver's data structure. But fortunately the kernel is smart enough not to create this mess. (And also, MSI-X interrupts are never shared so this is doubly irrelevant in this particular case) - R.