diff --git a/drivers/xen/v2v/v2v.c b/drivers/xen/v2v/v2v.c
-index 1bcab10..c79a2ed 100644
+index 1bcab10..5cbb5d0 100644
--- a/drivers/xen/v2v/v2v.c
+++ b/drivers/xen/v2v/v2v.c
-@@ -1253,7 +1253,26 @@ v2v_disconnect_supplicant(const struct v2v_channel *_channel)
+@@ -1253,7 +1253,31 @@ v2v_disconnect_supplicant(const struct v2v_channel *_channel)
int err;
struct v2v_channel *channel = (struct v2v_channel *)_channel;
- /* The grant mapping and vm areas are cleaned up in v2v_destroy_channel() */
++ if (! channel ||
++ ! channel->u.supplicant.prod_area ||
++ ! channel->u.supplicant.cons_area)
++ return -EINVAL;
++
+ /* Have to clean up the grant mapping and vm areas here before setting the state to disconnected
+ or the temple disconnect could fail. */
+ v2v_xenops_grant_unmap(channel->u.supplicant.prod_area,
channel->prod_sring = NULL;
channel->cons_sring = NULL;
channel->control = NULL;
-@@ -1261,6 +1280,7 @@ v2v_disconnect_supplicant(const struct v2v_channel *_channel)
+@@ -1261,6 +1285,7 @@ v2v_disconnect_supplicant(const struct v2v_channel *_channel)
v2v_close_receive_evtchn(channel);
v2v_close_send_evtchn(channel);