Thread (6 messages) flat view 6 messages, 4 authors, 2021-08-09

Re: [PATCH net-next] net: sock: add the case if sk is NULL

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-08-06 13:12:34
Also in: lkml

On Fri,  6 Aug 2021 14:38:15 +0800 Yajun Deng wrote:
Add the case if sk is NULL in sock_{put, hold},
The caller is free to use it.

Signed-off-by: Yajun Deng <redacted>
The obvious complaint about this patch (and your previous netdev patch)
is that you're spraying branches everywhere in the code. Sure, it may
be okay for free(), given how expensive of an operation that is but
is having refcounting functions accept NULL really the best practice?

Can you give us examples in the kernel where that's the case?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help