From 1eda71f1b3784987ed8368f3bebb3360cae74ba4 Mon Sep 17 00:00:00 2001 From: Arun Kumar Neelakantam Date: Thu, 9 Apr 2015 14:44:11 +0530 Subject: [PATCH] soc: qcom: glink_pkt: Initialize the glink handle to NULL In error case the glink_open() API returns different error codes in pointers and assigning these error code pointer to the handle will fail NULL check conditions. Initialize the handle pointer to NULL when glink_open() fails. Change-Id: I2ea24005c127da4ff5d8aabbeaac9944d061c518 Signed-off-by: Arun Kumar Neelakantam --- drivers/soc/qcom/msm_glink_pkt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/qcom/msm_glink_pkt.c b/drivers/soc/qcom/msm_glink_pkt.c index 35d29fbce47f..2b628fb2feca 100644 --- a/drivers/soc/qcom/msm_glink_pkt.c +++ b/drivers/soc/qcom/msm_glink_pkt.c @@ -767,6 +767,7 @@ int glink_pkt_open(struct inode *inode, struct file *file) __func__, devp->open_cfg.transport, devp->open_cfg.edge, devp->open_cfg.name); ret = -ENODEV; + devp->handle = NULL; goto error; }