[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH 11/29] drivers, media: convert cx88_core.refcount from atomic_t to refcount_t
- To: Elena Reshetova <elena.reshetova@xxxxxxxxx>, gregkh@xxxxxxxxxxxxxxxxxxx
- From: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 6 Mar 2017 19:26:23 +0300
- Cc: devel@xxxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, open-iscsi@xxxxxxxxxxxxxxxx, Kees Cook <keescook@xxxxxxxxxxxx>, linux-scsi@xxxxxxxxxxxxxxx, David Windsor <dwindsor@xxxxxxxxx>, peterz@xxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-raid@xxxxxxxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, linux-serial@xxxxxxxxxxxxxxx, devel@xxxxxxxxxxxxxxxxxxxxxx, fcoe-devel@xxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux1394-devel@xxxxxxxxxxxxxxxxxxxxx, Hans Liljestrand <ishkamiel@xxxxxxxxx>, linux-media@xxxxxxxxxxxxxxx
- Delivery-date: Mon, 06 Mar 2017 16:26:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
Hello.
On 03/06/2017 05:20 PM, Elena Reshetova wrote:
refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.
Signed-off-by: Elena Reshetova <elena.reshetova@xxxxxxxxx>
Signed-off-by: Hans Liljestrand <ishkamiel@xxxxxxxxx>
Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Signed-off-by: David Windsor <dwindsor@xxxxxxxxx>
[...]
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h
index 115414c..16c1313 100644
--- a/drivers/media/pci/cx88/cx88.h
+++ b/drivers/media/pci/cx88/cx88.h
@@ -24,6 +24,7 @@
#include <linux/i2c-algo-bit.h>
#include <linux/videodev2.h>
#include <linux/kdev_t.h>
+#include <linux/refcount.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
@@ -339,7 +340,7 @@ struct cx8802_dev;
struct cx88_core {
struct list_head devlist;
- atomic_t refcount;
+ refcount_t refcount;
Could you please keep the name aligned with above and below?
/* board name */
int nr;
MBR, Sergei
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|