Skip to content

Commit

Permalink
xen/pvcalls: fix null pointer dereference on map->sock
Browse files Browse the repository at this point in the history
Currently if map is null then a potential null pointer deference
occurs when calling sock_release on map->sock.  I believe the
actual intention was to call sock_release on sock instead. Fix
this.

Fixes: 5db4d28 ("xen/pvcalls: implement connect command")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
  • Loading branch information
Colin Ian King authored and Juergen Gross committed Feb 26, 2018
1 parent d1a75e0 commit 68d2059
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/pvcalls-back.c
Original file line number Diff line number Diff line change
@@ -416,7 +416,7 @@ static int pvcalls_back_connect(struct xenbus_device *dev,
sock);
if (!map) {
ret = -EFAULT;
sock_release(map->sock);
sock_release(sock);
}

out:

0 comments on commit 68d2059

Please sign in to comment.