From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946Ab3CJBwS (ORCPT ); Sat, 9 Mar 2013 20:52:18 -0500 Received: from intranet.asianux.com ([58.214.24.6]:39575 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751693Ab3CJBwR (ORCPT ); Sat, 9 Mar 2013 20:52:17 -0500 X-Spam-Score: -100.8 Message-ID: <513BE738.3080806@asianux.com> Date: Sun, 10 Mar 2013 09:51:52 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Russell King - ARM Linux CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] ARM:kernel: beautify code, rel->r_offset is __u32 which never < 0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rel->r_offset is __u32 which never < 0. it is defined in uapi/linux/elf.h Signed-off-by: Chen Gang --- arch/arm/kernel/module.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 1e9be5d..386086e 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c @@ -74,7 +74,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, sym = ((Elf32_Sym *)symsec->sh_addr) + offset; symname = strtab + sym->st_name; - if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - sizeof(u32)) { + if (rel->r_offset > dstsec->sh_size - sizeof(u32)) { pr_err("%s: section %u reloc %u sym '%s': out of bounds relocation, offset %d size %u\n", module->name, relindex, i, symname, rel->r_offset, dstsec->sh_size); -- 1.7.7.6