Re: [Patch v10 01/12] net: mana: Add support for auxiliary device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 08, 2022 at 09:33:21PM +0000, Long Li wrote:
> 
> > > int mana_probe(struct gdma_dev *gd, bool resuming)
> > >  				break;
> > >  		}
> > >  	}
> > > +
> > > +	err = add_adev(gd);
> > >  out:
> > >  	if (err)
> > >  		mana_remove(gd, false);
> > > @@ -2189,6 +2267,10 @@ void mana_remove(struct gdma_dev *gd, bool
> > suspending)
> > >  	int err;
> > >  	int i;
> > >
> > > +	/* adev currently doesn't support suspending, always remove it */
> > > +	if (gd->adev)
> > 
> > This condition is always true, isn't it?
> 
> I think the check is necessary. mana_probe() will call mana_remove() if it fails to
> add this adev to gd. If this is the case, we can't call remove_adev().

I'm sad to hear that. It is so anti-pattern to hide error unwind in one global function.
But ok, it is already there, so let's take this series as is.

Thanks

> 
> Thanks,
> Long



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux