Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1405038
| From | Max Filippov <jcmvbkbc@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net/ethoc: fix null dereference on error exit path |
| Date | 2016-05-22 21:50 +0200 |
| Message-ID | <rBHxU-4H7-7@gated-at.bofh.it> (permalink) |
| References | <rBGVc-4wz-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Colin, On Sun, May 22, 2016 at 08:08:18PM +0100, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > priv is assigned to NULL however all the error exit paths to label 'free' > dereference priv, causing a null pointer dereference. > > Examination of the code shows that all error exits via the 'free' > label path occur before priv is assigned to netdev_priv(netdev), hence > there is no need to call clk_disable_unprepare and so the location of > the label should be moved to free_netdev statement to avoid this null > dereference on priv. This description is a bit inaccurate. Indeed all 'goto free' above the 'priv = netdev_priv(netdev);' need to skip 'if (priv->clk)' check, but there are two more 'goto free' below that line, and they look correct now, but after this patch they'll leave the clock enabled. -- Thanks. -- Max
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] net/ethoc: fix null dereference on error exit path Colin King <colin.king@canonical.com> - 2016-05-22 21:10 +0200
Re: [PATCH] net/ethoc: fix null dereference on error exit path Max Filippov <jcmvbkbc@gmail.com> - 2016-05-22 21:50 +0200
Re: [PATCH] net/ethoc: fix null dereference on error exit path Colin Ian King <colin.king@canonical.com> - 2016-05-22 23:30 +0200
csiph-web