Re: [PATCH net] libceph: osdmap: Fix some NULL dereferences

2017-07-13 Thread Dan Carpenter
On Thu, Jul 13, 2017 at 06:13:22PM +0200, Ilya Dryomov wrote: > > Hi Dan, > > I applied osdmap_apply_incremental() hunk and fixed a similar bug in > osdmap_decode() (it's a not NULL deref, that's why smatch didn't catch > it). > No... :/ Smatch complained about it, but I somehow marked it as

Re: [PATCH net] libceph: osdmap: Fix some NULL dereferences

2017-07-13 Thread Ilya Dryomov
On Thu, Jul 13, 2017 at 9:45 AM, Dan Carpenter wrote: > There are hidden gotos in the ceph_decode_* macros. We need to set the > "err" variable on these error paths otherwise we end up returning > ERR_PTR(0) which is NULL. It causes NULL dereferences in the callers. > > Fixes: 278b1d709c6a ("lib

[PATCH net] libceph: osdmap: Fix some NULL dereferences

2017-07-13 Thread Dan Carpenter
There are hidden gotos in the ceph_decode_* macros. We need to set the "err" variable on these error paths otherwise we end up returning ERR_PTR(0) which is NULL. It causes NULL dereferences in the callers. Fixes: 278b1d709c6a ("libceph: ceph_decode_skip_* helpers") Signed-off-by: Dan Carpenter