Subject: Re: [PATCH 2/2] eeh: fixing pci_dev dependency

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 29 Jan 2010 11:04:47 +1100

On Wed, 2010-01-27 at 12:43 -0600, [email-masked] 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 <[email-masked]>
> Signed-off-by: Linas Vepstas <[email-masked]>
> ---
>  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);
>