summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDurga Prasada Rao BATHINA <durgaprasadarao.b@stericcson.com>2011-08-24 19:17:21 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2011-12-06 11:01:16 +0100
commit45edfaa5dbdebb38d0eddd6d30e9d323e697b655 (patch)
tree3027fb12b61451b785c567354fafb840b971dcf1
parent7dd431c4691793b86b628a0d2f0f7a11416eaa93 (diff)
CAIF : coverity issues
free phy_driver memory and initialize linkid to 0. ST-Ericsson ID: 358047 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: Icb295648b23bd836b9f5a40a0b605e4792a8511d Signed-off-by: Durga Prasada Rao BATHINA <durgaprasadarao.b@stericcson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31751 Reviewed-by: Bibek BASU <bibek.basu@stericsson.com> Tested-by: Bibek BASU <bibek.basu@stericsson.com>
-rw-r--r--include/net/caif/cfserl.h1
-rw-r--r--net/caif/cfcnfg.c2
-rw-r--r--net/caif/cfserl.c6
3 files changed, 9 insertions, 0 deletions
diff --git a/include/net/caif/cfserl.h b/include/net/caif/cfserl.h
index b8374321b36..8ac284c5de2 100644
--- a/include/net/caif/cfserl.h
+++ b/include/net/caif/cfserl.h
@@ -9,4 +9,5 @@
#include <net/caif/caif_layer.h>
struct cflayer *cfserl_create(int type, int instance, bool use_stx);
+void cfserl_destroy(struct cflayer *layer);
#endif /* CFSERL_H_ */
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
index 52fe33bee02..7debfd4a031 100644
--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -521,6 +521,8 @@ got_phyid:
frml = cffrml_create(phyid, fcs);
if (!frml) {
+ if (phy_driver)
+ cfserl_destroy(phy_driver);
pr_warn("Out of memory\n");
kfree(phyinfo);
goto out;
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
index 2715c84cfa8..403d57ad305 100644
--- a/net/caif/cfserl.c
+++ b/net/caif/cfserl.c
@@ -190,3 +190,9 @@ static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
{
layr->up->ctrlcmd(layr->up, ctrl, phyid);
}
+
+void cfserl_destroy(struct cflayer *layer)
+{
+ struct cfserl *cfserl = container_obj(layer);
+ kfree(cfserl);
+}