Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754813AbdCGH7F (ORCPT ); Tue, 7 Mar 2017 02:59:05 -0500 Received: from mga04.intel.com ([192.55.52.120]:32734 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751258AbdCGH6j (ORCPT ); Tue, 7 Mar 2017 02:58:39 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,257,1484035200"; d="scan'208";a="56976479" From: "Reshetova, Elena" To: Sergei Shtylyov , "gregkh@linuxfoundation.org" 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 Subject: RE: [PATCH 11/29] drivers, media: convert cx88_core.refcount from atomic_t to refcount_t Thread-Topic: [PATCH 11/29] drivers, media: convert cx88_core.refcount from atomic_t to refcount_t Thread-Index: AQHSloUdpMza5pxA+0Wz73xlo3ZITaGH/7+AgAECQlA= Date: Tue, 7 Mar 2017 07:52:09 +0000 Message-ID: <2236FBA76BA1254E88B949DDB74E612B41C556E2@IRSMSX102.ger.corp.intel.com> References: <1488810076-3754-1-git-send-email-elena.reshetova@intel.com> <1488810076-3754-12-git-send-email-elena.reshetova@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v277xlpa029633 Content-Length: 1468 Lines: 50 > 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? You mean "not aligned" to devlist, but with a shift like it was before? Sure, will fix. Is the patch ok otherwise? Best Regards, Elena. > > > > > /* board name */ > > int nr; > > > > MBR, Sergei