diff
+#define CHECK_NULL(ptr) if (!(ptr)) return;
+
 void vmbus_free_ring(struct vmbus_channel *channel)
 {
+    CHECK_NULL(channel);
     hv_ringbuffer_cleanup(&channel->outbound);
     hv_ringbuffer_cleanup(&channel->inbound);
