]> git.baikalelectronics.ru Git - kernel.git/commit
sock: fix potential memory leak in proto_register()
authorzhanglin <zhang.lin16@zte.com.cn>
Fri, 23 Aug 2019 01:14:11 +0000 (09:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Aug 2019 23:33:14 +0000 (16:33 -0700)
commited01075a94bdb2c7c6c504abf7467c1ff4732bd7
tree3d71b2aed3171ceb1cdcc3f1152da20b19fa2c62
parent3179dc165f36a5a37c201d0b4608b44db080870a
sock: fix potential memory leak in proto_register()

If protocols registered exceeded PROTO_INUSE_NR, prot will be
added to proto_list, but no available bit left for prot in
proto_inuse_idx.

Changes since v2:
* Propagate the error code properly

Signed-off-by: zhanglin <zhang.lin16@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c