Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1313036

Re: [PATCH v2 next-next] net: hns: enet specifies a reference to dsaf

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 next-next] net: hns: enet specifies a reference to dsaf
Date 2016-01-20 10:40 +0100
Message-ID <qSXp7-4uM-7@gated-at.bofh.it> (permalink)
References <qQjPc-1CH-7@gated-at.bofh.it> <qQGsq-Pk-11@gated-at.bofh.it> <qQMHw-59v-19@gated-at.bofh.it> <qSXp7-4uM-9@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


On Wed, 2016-01-20 at 14:49 +0800, Yankejian (Hackim Yim) wrote:
> > > +
> > > > > > +	snprintf(ae_dev->name, AE_NAME_SIZE, "%s%d",
> > > > > > DSAF_DEVICE_NAME,
> > > > > > +		 (int)atomic_inc_return(&id));
> > If you bind/unbind device enough times you may get an overflow and
> > end
> > up with name of existing device (if you have 1+ of them in the
> > system).
> > 
> > To avoid such situation better to use IDA/IDR framework.
> > 
> Hi, Andy
> Thanks again for your suggestion.
> It seems that using IDA/IDR framework is better, but all of the
> functions must be serialized by lock.

AFAIR it's designed in a way you don't need to do any additional
locking or synchronization.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 next-next] net: hns: enet specifies a reference to  dsaf Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-20 10:40 +0100
  Re: [PATCH v2 next-next] net: hns: enet specifies a reference to dsaf "Yankejian (Hackim Yim)" <yankejian@huawei.com> - 2016-01-20 12:20 +0100

csiph-web