From: "Reshetova, Elena" <elena.reshetova@intel.com>
To: Julia Lawall <julia.lawall@lip6.fr>,
"Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kbuild-all@01.org" <kbuild-all@01.org>
Subject: RE: [PATCH] ZEN: fix platform_no_drv_owner.cocci warnings
Date: Mon, 15 Apr 2019 06:31:03 +0000 [thread overview]
Message-ID: <2236FBA76BA1254E88B949DDB74E612BA4C4F65E@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1904140748230.2615@hadrien>
> From: kbuild test robot <lkp@intel.com>
>
> 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@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>
> ---
>
> 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.
prev parent reply other threads:[~2019-04-15 6:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-14 5:50 Julia Lawall
2019-04-15 6:31 ` Reshetova, Elena [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2236FBA76BA1254E88B949DDB74E612BA4C4F65E@IRSMSX102.ger.corp.intel.com \
--to=elena.reshetova@intel.com \
--cc=jan.steffens@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=julia.lawall@lip6.fr \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®