From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754421AbdCFQew (ORCPT ); Mon, 6 Mar 2017 11:34:52 -0500 Received: from mail-lf0-f41.google.com ([209.85.215.41]:33449 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754507AbdCFQdY (ORCPT ); Mon, 6 Mar 2017 11:33:24 -0500 Subject: Re: [PATCH 11/29] drivers, media: convert cx88_core.refcount from atomic_t to refcount_t To: Elena Reshetova , gregkh@linuxfoundation.org References: <1488810076-3754-1-git-send-email-elena.reshetova@intel.com> <1488810076-3754-12-git-send-email-elena.reshetova@intel.com> Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, netdev@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-media@vger.kernel.org, devel@linuxdriverproject.org, linux-pci@vger.kernel.org, linux-s390@vger.kernel.org, fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com, devel@driverdev.osuosl.org, target-devel@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, peterz@infradead.org, Hans Liljestrand , Kees Cook , David Windsor From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Mon, 6 Mar 2017 19:26:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1488810076-3754-12-git-send-email-elena.reshetova@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > Signed-off-by: Hans Liljestrand > Signed-off-by: Kees Cook > Signed-off-by: David Windsor [...] > 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 > #include > #include > +#include > > #include > #include > @@ -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