Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: qrtr: ns: Return 0 if server port is not present

When a 'DEL_CLIENT' message is received from the remote, the corresponding
server port gets deleted. A DEL_SERVER message is then announced for this
server. As part of handling the subsequent DEL_SERVER message, the name-
server attempts to delete the server port which results in a '-ENOENT' error.
The return value from server_del() is then propagated back to qrtr_ns_worker,
causing excessive error prints.
To address this, return 0 from control_cmd_del_server() without checking the
return value of server_del(), since the above scenario is not an error case
and hence server_del() doesn't have any other error return value.

Signed-off-by: Sarannya Sasikumar <quic_sarannya@quicinc.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sarannya S and committed by
David S. Miller
9bf2e916 82585d5e

+3 -1
+3 -1
net/qrtr/ns.c
··· 512 512 if (!node) 513 513 return -ENOENT; 514 514 515 - return server_del(node, port, true); 515 + server_del(node, port, true); 516 + 517 + return 0; 516 518 } 517 519 518 520 static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,