linux-cp: fix issue of possibly closing negative fd 47/35547/3
authorAlexander Chernavin <[email protected]>
Fri, 4 Mar 2022 13:18:15 +0000 (13:18 +0000)
committerMatthew Smith <[email protected]>
Fri, 4 Mar 2022 22:30:21 +0000 (22:30 +0000)
commit7e721954d4ea31a26ad44872acc199c91b9595e6
treefb09b50a1a1166fd2ac745305ee40a2a336e305f
parent2286f937d9a805324a8e46ba5a17198c039ba91a
linux-cp: fix issue of possibly closing negative fd

Type: fix

Primarily fix an issue reported by Coverity in
lcp_nl_open_sync_socket() that close() could possibly be run with
negative fd. Also, add more checks and error logging there.

Signed-off-by: Alexander Chernavin <[email protected]>
Change-Id: I9a88520d068392977a6eba0766451e5652fe512c
src/plugins/linux-cp/lcp_nl.c