Re: [PATCH] netpoll: Fix device name check in netpoll_setup()

2017-07-26 Thread David Miller
From: Matthias Kaehlcke Date: Tue, 25 Jul 2017 11:36:25 -0700 > Apparently netpoll_setup() assumes that netpoll.dev_name is a pointer > when checking if the device name is set: > > if (np->dev_name) { > ... > > However the field is a character array, therefore the condition always > yields tr

Re: [PATCH] netpoll: Fix device name check in netpoll_setup()

2017-07-26 Thread Cong Wang
On Wed, Jul 26, 2017 at 11:44 AM, Doug Anderson wrote: > Hi, > > On Tue, Jul 25, 2017 at 11:36 AM, Matthias Kaehlcke wrote: >> Apparently netpoll_setup() assumes that netpoll.dev_name is a pointer >> when checking if the device name is set: >> >> if (np->dev_name) { >> ... >> >> However the fie

Re: [PATCH] netpoll: Fix device name check in netpoll_setup()

2017-07-26 Thread Doug Anderson
Hi, On Tue, Jul 25, 2017 at 11:36 AM, Matthias Kaehlcke wrote: > Apparently netpoll_setup() assumes that netpoll.dev_name is a pointer > when checking if the device name is set: > > if (np->dev_name) { > ... > > However the field is a character array, therefore the condition always > yields tru

[PATCH] netpoll: Fix device name check in netpoll_setup()

2017-07-25 Thread Matthias Kaehlcke
Apparently netpoll_setup() assumes that netpoll.dev_name is a pointer when checking if the device name is set: if (np->dev_name) { ... However the field is a character array, therefore the condition always yields true. Check instead whether the first byte of the array has a non-zero value. Sig