Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932973AbbLSJR5 (ORCPT ); Sat, 19 Dec 2015 04:17:57 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35153 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932145AbbLSJRx (ORCPT ); Sat, 19 Dec 2015 04:17:53 -0500 From: "Luis R. Rodriguez" To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, "Luis R. Rodriguez" , Hannes Reinecke , Dmitry Torokhov , stable@vger.kernel.org (4.2+) Subject: [PATCH] driver-core: fix modparam async_probe request Date: Sat, 19 Dec 2015 01:17:44 -0800 Message-Id: <1450516664-4200-1-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 2.6.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2304 Lines: 72 From: "Luis R. Rodriguez" Commit f2411da746985 ("driver-core: add driver module asynchronous probe support") added async probe support, in two forms: * in-kernel driver specification annotation * generic async_probe module parameter (modprobe foo async_probe) To support the generic kernel parameter parse_args() was extended via commit ecc8617053e0 ("module: add extra argument for parse_params() callback") however commit failed to f2411da746985 failed to add the required argument. This causes a crash then whenever async_probe generic module parameter is used. This was overlooked when the form in which in-kernel async probe support was reworked a bit... Fix this as originally intended. Cc: Hannes Reinecke Cc: Dmitry Torokhov Cc: stable@vger.kernel.org (4.2+) Signed-off-by: Luis R. Rodriguez --- kernel/module.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 8f051a106676..88100ea77c55 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -3402,16 +3402,22 @@ out: static int unknown_module_param_cb(char *param, char *val, const char *modname, void *arg) { - struct module *mod = arg; + struct module *mod; int ret; if (strcmp(param, "async_probe") == 0) { + mod = arg; + if (!mod) { + ret = -ENOENT; + goto out; + } mod->async_probe_requested = true; return 0; } /* Check for magic 'dyndbg' arg */ ret = ddebug_dyndbg_module_param_cb(param, val, modname); +out: if (ret != 0) pr_warn("%s: unknown parameter '%s' ignored\n", modname, param); return 0; @@ -3515,7 +3521,7 @@ static int load_module(struct load_info *info, const char __user *uargs, /* Module is ready to execute: parsing args may do that. */ after_dashes = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, - -32768, 32767, NULL, + -32768, 32767, mod, unknown_module_param_cb); if (IS_ERR(after_dashes)) { err = PTR_ERR(after_dashes); -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/