From mboxrd@z Thu Jan 1 00:00:00 1970 From: "K. Y. Srinivasan" Subject: [PATCH 114/117] Staging: hv: vmbus: Check before invoking the channel callback Date: Fri, 15 Jul 2011 10:47:42 -0700 Message-ID: <1310752065-27895-114-git-send-email-kys@microsoft.com> References: <1310752024-27854-1-git-send-email-kys@microsoft.com> <1310752065-27895-1-git-send-email-kys@microsoft.com> Return-path: In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com> Sender: linux-kernel-owner@vger.kernel.org To: gregkh@suse.de, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, virtualization@lists.osdl.org Cc: "K. Y. Srinivasan" , Haiyang Zhang List-Id: virtualization@lists.linuxfoundation.org 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 --- drivers/staging/hv/connection.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c index a88ad70..7a3ec75 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); -- 1.7.4.1