Skip to content

Commit

Permalink
Staging: hv: vmbus: Check before invoking the channel callback
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 29, 2011
1 parent 95ff7cd commit 76c39d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/hv/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 76c39d4

Please sign in to comment.