From 2e8da1830fd23687764bcdcdca3f2dc29f1b6793 Mon Sep 17 00:00:00 2001 From: Tianyi Gou Date: Thu, 28 Jun 2012 17:19:37 -0700 Subject: [PATCH] msm: pil: Fix loadable segment type check Currently, a segment's p_type value from program head is bitwise AND with PT_LOAD type constant to determine if it's a loadable segment. This might cause problem when the p_type value of a non-LOAD segment has the PT_LOAD bit set. For example, the GNU_STACK segment. Fix this by comparing p_type value against PT_LOAD type constant. Change-Id: Ie293dfd3ad744fc5dab3d9a6e7992f42d609b17c Signed-off-by: Tianyi Gou --- arch/arm/mach-msm/peripheral-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-msm/peripheral-loader.c b/arch/arm/mach-msm/peripheral-loader.c index bfbf4bc19fa..16c21f72fe3 100644 --- a/arch/arm/mach-msm/peripheral-loader.c +++ b/arch/arm/mach-msm/peripheral-loader.c @@ -226,7 +226,7 @@ release_fw: static int segment_is_loadable(const struct elf32_phdr *p) { - return (p->p_type & PT_LOAD) && !segment_is_hash(p->p_flags); + return (p->p_type == PT_LOAD) && !segment_is_hash(p->p_flags); } /* Sychronize request_firmware() with suspend */