From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 44917B7D0A for ; Fri, 29 Jan 2010 11:04:56 +1100 (EST) Subject: Re: [PATCH 2/2] eeh: fixing pci_dev dependency From: Benjamin Herrenschmidt To: leitao@linux.vnet.ibm.com In-Reply-To: <930155d7427ae670cd2add220649c6490f68d0d4.1264617281.git.root@sanx1002.austin.ibm.com> References: <0642ead63df1b9fdced24750eb0aea940f0408b7.1264617281.git.root@sanx1002.austin.ibm.com> <930155d7427ae670cd2add220649c6490f68d0d4.1264617281.git.root@sanx1002.austin.ibm.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 29 Jan 2010 11:04:47 +1100 Message-ID: <1264723487.20211.17.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org, Linas Vepstas List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2010-01-27 at 12:43 -0600, leitao@linux.vnet.ibm.com wrote: > Currently pci_dev can be null when EEH is in action. This patch > just assure that we pci_dev is not NULL before calling pci_dev_put. Like all variants of *_put(), it already checks for a NULL argument afaik. So that patch should be unnecessary. Cheers, Ben. > Signed-off-by: Breno Leitao > Signed-off-by: Linas Vepstas > --- > arch/powerpc/platforms/pseries/eeh_event.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c > index ec5df8f..7956e46 100644 > --- a/arch/powerpc/platforms/pseries/eeh_event.c > +++ b/arch/powerpc/platforms/pseries/eeh_event.c > @@ -85,7 +85,8 @@ static int eeh_event_handler(void * dummy) > pdn = handle_eeh_events(event); > > eeh_clear_slot(event->dn, EEH_MODE_RECOVERING); > - pci_dev_put(event->dev); > + if (event->dev) > + pci_dev_put(event->dev); > kfree(event); > mutex_unlock(&eeh_event_mutex); >