From: K. Y. Srinivasan Date: Sat, 27 Aug 2011 18:31:32 +0000 (-0700) Subject: Staging: hv: vmbus: Check before invoking the channel callback X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=76c39d429d606d8f9b354ee2b1973b76c8331b1f;p=linux-beck.git Staging: hv: vmbus: Check before invoking the channel callback 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 Signed-off-by: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c index a88ad7072566..7a3ec75bab18 100644 --- a/drivers/staging/hv/connection.c +++ b/drivers/staging/hv/connection.c @@ -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);