dbll_create() leaks pzl_target if target_obj is NULL. Call kzalloc() only if memory is used. Signed-off-by: Kulikov Vasiliy <segooon@xxxxxxxxx> --- drivers/staging/tidspbridge/pmgr/dbll.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c index 3636aa3..86840ce 100644 --- a/drivers/staging/tidspbridge/pmgr/dbll.c +++ b/drivers/staging/tidspbridge/pmgr/dbll.c @@ -247,9 +247,9 @@ int dbll_create(struct dbll_tar_obj **target_obj, DBC_REQUIRE(pattrs != NULL); DBC_REQUIRE(target_obj != NULL); - /* Allocate DBL target object */ - pzl_target = kzalloc(sizeof(struct dbll_tar_obj), GFP_KERNEL); if (target_obj != NULL) { + /* Allocate DBL target object */ + pzl_target = kzalloc(sizeof(struct dbll_tar_obj), GFP_KERNEL); if (pzl_target == NULL) { *target_obj = NULL; status = -ENOMEM; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html