RE: [PATCH] ZEN: fix platform_no_drv_owner.cocci warnings

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

 



> From: kbuild test robot <lkp@xxxxxxxxx>
> 
> Remove .owner field if calls are used which set it automatically
> 
> Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
> 
> Fixes: 26e2aa63d568 ("ZEN: Add VHBA driver")
> Signed-off-by: kbuild test robot <lkp@xxxxxxxxx>
> Signed-off-by: Julia Lawall <julia.lawall@xxxxxxx>
> 
> ---
> 
> There was also a report about:
> 
> drivers/scsi/vhba/vhba.c:184:8-27: atomic_dec_and_test variation before
> object free at line 185.
> 
> that Elena may want to comment on.
> 
>

Yes, on a quick look it seems that you should be using refcount_t type and not
atomic_t for your reference counter, as you use it as classical refcounter, i.e. 
free  the object upon reaching zero, etc:

static void vhba_device_put (struct vhba_device *vdev)
{
    if (atomic_dec_and_test(&vdev->refcnt)) {
        kfree(vdev);
    }
}

Any reason why you didn't use refcount_t type to begin with?

Best Regards,
Elena.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux