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 247C4C10F11 for ; Wed, 24 Apr 2019 17:59:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA02620652 for ; Wed, 24 Apr 2019 17:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556128775; bh=wYJvOLFXM690ZlUhoZRZMWv4lJTdf5IP3GfcarvN2mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ul2W0QrSphhmZeyScrzxK8SQ0i1FlYSrTcmSS+T0Sed1kDcJt9Vp9TrvyNvDhb9/K 3BpnfLQF7tzWj7Op+WbyT8OJ+enGj8pZQh+CkhKWw7j2jJdv5tnR+FDd/rGSYLI7c4 X3H+bIcnIgjnTh0gW3ZzIcujSdKswIaImtkJC4Ao= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389839AbfDXR72 (ORCPT ); Wed, 24 Apr 2019 13:59:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:50056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389486AbfDXRYM (ORCPT ); Wed, 24 Apr 2019 13:24:12 -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 340EB205ED; Wed, 24 Apr 2019 17:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126651; bh=wYJvOLFXM690ZlUhoZRZMWv4lJTdf5IP3GfcarvN2mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IrPi19eSoJDgcUtpPuetmezvBAurDfET8F1150MgdGwV4iLhLKAOUeHtKOng/Ib9f ZkSfjgf8uFpQN3bUkM1WN6hRiiljAczdc6beMekuVzK08TTqw2uwx3v6SGaZEUmgaO iDVJ3mRCY6TunGDImIPlpLVvrSQmY4AHimieC+jY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Mathieu Malaterre , Nathan Chancellor , Sasha Levin Subject: [PATCH 4.9 14/44] modpost: file2alias: check prototype of handler Date: Wed, 24 Apr 2019 19:09:52 +0200 Message-Id: <20190424170851.046078468@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170839.924291114@linuxfoundation.org> References: <20190424170839.924291114@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 commit f880eea68fe593342fa6e09be9bb661f3c297aec upstream. 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: Nathan Chancellor 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 6e3ae94cf123..55b4c0dc2b93 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 @@ -1228,12 +1228,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. */ @@ -1346,7 +1345,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