Staging: hv: vmbus: Check before invoking the channel callback
authorK. Y. Srinivasan <kys@microsoft.com>
Sat, 27 Aug 2011 18:31:32 +0000 (11:31 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 29 Aug 2011 18:05:30 +0000 (11:05 -0700)
When we close a channel, we set the corresponding callback function to NULL.
Check before invoking the channel callback.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/connection.c

index a88ad70..7a3ec75 100644 (file)
@@ -222,7 +222,7 @@ static void process_chn_event(u32 relid)
         */
        channel = relid2channel(relid);
 
-       if (channel) {
+       if (channel && (channel->onchannel_callback != NULL)) {
                channel->onchannel_callback(channel->channel_callback_context);
        } else {
                pr_err("channel not found for relid - %u\n", relid);