pvcalls-front: fix potential null dereference
[sfrench/cifs-2.6.git] / drivers / xen / pvcalls-front.c
index 307861f9e485724f3f747d4c99f4967db7966f6c..8a249c95c19342059d9eb06dcf1aeb74f4936458 100644 (file)
@@ -343,6 +343,9 @@ int pvcalls_front_socket(struct socket *sock)
 
 static void free_active_ring(struct sock_mapping *map)
 {
+       if (!map->active.ring)
+               return;
+
        free_pages((unsigned long)map->active.data.in,
                        map->active.ring->ring_order);
        free_page((unsigned long)map->active.ring);