From 5cfc6d2291a7ee232054040aedfc3dcf00261c7d Mon Sep 17 00:00:00 2001 From: Mohammed Nayeem Ur Rahman Date: Thu, 23 Apr 2020 20:15:37 +0530 Subject: [PATCH] msm: adsprpc : Change to resolve undefined behaviour Resolving the undefined behaviour scenario where if adsp proc init fails return error and not to goto bail to deinitialize memory and unlock mutex. Change-Id: Idf107aa340a211edec9121249e090c3e7c0e2200 Acked-by: Gururaj Chalger Signed-off-by: Mohammed Nayeem Ur Rahman --- drivers/char/adsprpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index f41acc09c08d..ed0e08931640 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -3626,7 +3626,7 @@ static int fastrpc_internal_munmap(struct fastrpc_file *fl, pr_err("adsprpc: ERROR: %s: user application %s trying to unmap without initialization\n", __func__, current->comm); err = EBADR; - goto bail; + return err; } mutex_lock(&fl->internal_map_mutex);