Commit b9104ebc authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

sockets: Fix potential NULL dereference

In case if unix socket was not found don't call for container_of.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 81c72ea6
...@@ -806,7 +806,9 @@ static struct unix_sk_info *find_unix_sk(int id) ...@@ -806,7 +806,9 @@ static struct unix_sk_info *find_unix_sk(int id)
struct file_desc *d; struct file_desc *d;
d = find_file_desc_raw(FDINFO_UNIXSK, id); d = find_file_desc_raw(FDINFO_UNIXSK, id);
return container_of(d, struct unix_sk_info, d); if (d)
return container_of(d, struct unix_sk_info, d);
return NULL;
} }
struct sk_packet { struct sk_packet {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment