Re: [PATCH V2 1/1] can: sja1000: f81601: add Fintek F81601 support

From: Saeed Mahameed
Date: Wed Jul 24 2019 - 15:47:00 EST


On Wed, 2019-07-24 at 13:19 +0800, Ji-Ze Hong (Peter Hong) wrote:
> Hi,
>
> Saeed Mahameed æ 2019/7/24 äå 05:38 åé:
> > On Mon, 2019-07-22 at 14:22 +0800, Ji-Ze Hong (Peter Hong) wrote:
> > > This patch add support for Fintek PCIE to 2 CAN controller
> > > support
> > >
> > > Signed-off-by: Ji-Ze Hong (Peter Hong) <
> > > hpeter+linux_kernel@xxxxxxxxx
> > > ---
> > > Changelog:
> > > v2:
> > > 1: Fix comment on the spinlock with write access.
> > > 2: Use ARRAY_SIZE instead of F81601_PCI_MAX_CHAN.
> > > 3: Check the strap pin outside the loop.
> > > 4: Fix the cleanup issue in f81601_pci_add_card().
> > > 5: Remove unused "channels" in struct f81601_pci_card.
> > >
> > > drivers/net/can/sja1000/Kconfig | 8 ++
> > > drivers/net/can/sja1000/Makefile | 1 +
> > > drivers/net/can/sja1000/f81601.c | 215
> > >

[...]

> > >
> > > + /* Detect available channels */
> > > + for (i = 0; i < count; i++) {
> > > + dev = alloc_sja1000dev(0);
> > > + if (!dev) {
> > > + err = -ENOMEM;
> > > + goto failure_cleanup;
> > > + }
> > > +
> >
> > don't you need to rollback and cleanup/unregister previously
> > allocated
> > devs ?
> >
>
> I'll do cleanup when errors jump to failure_cleanup label and do
> f81601_pci_del_card().
>

Right !, thanks for the clarification.