Re: [PATCH] ceph: Move a variable assignment behind a condition check in __ceph_remove_cap()
Dan Carpenter <[email protected]> Tue, 14 Jul 2026 10:19:11 +0300
| Newsgroups | org.kernel.vger.kernel-janitors,org.kernel.vger.ceph-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jul 13, 2026 at 03:10:40PM -0700, Viacheslav Dubeyko wrote: > On Mon, 2026-07-13 at 13:35 +0200, Markus Elfring wrote: > > From: Markus Elfring <[email protected]> > > Date: Mon, 13 Jul 2026 13:21:29 +0200 > > > > The address of a data structure member was determined before > > a corresponding null pointer check in the implementation of > > the function “__ceph_remove_cap”. > > > > Thus avoid the risk for undefined behaviour by moving the assignment > > for the variable “inode” behind a condition check. > > > > This issue was detected by using the Coccinelle software. > > > > Fixes: 38d46409c4639a1d659ebfa70e27a8bed6b8ee1d ("ceph: print cluster > > fsid and client global_id in all debug logs") > > Cc: [email protected] > > Signed-off-by: Markus Elfring <[email protected]> I have explained to Markus many times that these are not dereferences, they are just pointer math. So the original code works fine and does not need a Fixes tag or a CC to stable. And then Markus responds, "the C standard says we are not allowed to dereference NULL pointers"... Which is true, but again, it's not a dereference. regards, dan carpenter