From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C04DC10F11 for ; Wed, 24 Apr 2019 17:46:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AD5D21773 for ; Wed, 24 Apr 2019 17:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556127980; bh=3xQOJn8PT+SIFijIIaVzNyivPjxOv7QG8T97OZmuZmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=omy1sJyG+f3sBTDl9kJ+dYmj3ZDDAZUqLUOtj86V+HFzVih5+MNh9JGiVGsx04pXg IxLtksNFvCSU9RMCRFdMsRy+PCSBxXu6Z8eVMvm6hsR40m5T1o9lc4tVFmiVvQFu4V pACBQdmVBguMBDylkVqhm02AOIldZJt0UGZ3NvjY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391410AbfDXRcr (ORCPT ); Wed, 24 Apr 2019 13:32:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:59550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391402AbfDXRcq (ORCPT ); Wed, 24 Apr 2019 13:32:46 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4E5D21904; Wed, 24 Apr 2019 17:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556127166; bh=3xQOJn8PT+SIFijIIaVzNyivPjxOv7QG8T97OZmuZmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nl79auvrZ5vVtlxkEtmeHn/C6r3HuMP4/+rlDt2RG1iZ0sWk2Ml0U+5NTxjIc6y27 1oDuPleVfxuNTd7v2j1tSWf/mKwoOmXqYezVQVDtSKXdIE+vsAx3fnc58vZ6eKbKog U9w8K1oa4wywRHgEtvIoJi9+aFI6LoEUFh+0J1ts= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Mathieu Malaterre , Sasha Levin Subject: [PATCH 4.19 85/96] modpost: file2alias: check prototype of handler Date: Wed, 24 Apr 2019 19:10:30 +0200 Message-Id: <20190424170925.549766879@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170919.829037226@linuxfoundation.org> References: <20190424170919.829037226@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit f880eea68fe593342fa6e09be9bb661f3c297aec ] Use specific prototype instead of an opaque pointer so that the compiler can catch function prototype mismatch. Signed-off-by: Masahiro Yamada Reviewed-by: Mathieu Malaterre Signed-off-by: Sasha Levin --- scripts/mod/file2alias.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 9f3ebde7a0cd..7f40b6aab689 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -47,7 +47,7 @@ typedef struct { struct devtable { const char *device_id; /* name of table, __mod___*_device_table. */ unsigned long id_size; - void *function; + int (*do_entry)(const char *filename, void *symval, char *alias); }; /* Define a variable f that holds the value of field f of struct devid @@ -1288,12 +1288,11 @@ static bool sym_is(const char *name, unsigned namelen, const char *symbol) static void do_table(void *symval, unsigned long size, unsigned long id_size, const char *device_id, - void *function, + int (*do_entry)(const char *filename, void *symval, char *alias), struct module *mod) { unsigned int i; char alias[500]; - int (*do_entry)(const char *, void *entry, char *alias) = function; device_id_check(mod->name, device_id, size, id_size, symval); /* Leave last one: it's the terminator. */ @@ -1410,7 +1409,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, if (sym_is(name, namelen, p->device_id)) { do_table(symval, sym->st_size, p->id_size, - p->device_id, p->function, mod); + p->device_id, p->do_entry, mod); break; } } -- 2.19.1