Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp495482pxb; Wed, 3 Mar 2021 08:14:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbSIUyeoDlNp4KoP3z7Ot6cSLtbWY6Z6EgGH+JZTp47NeGOHnM1KYQbUBepvO0QSdVdL2d X-Received: by 2002:a17:906:30da:: with SMTP id b26mr26027390ejb.376.1614788081913; Wed, 03 Mar 2021 08:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614788081; cv=none; d=google.com; s=arc-20160816; b=nxskFlvte3EFLe2h1nsPGBMYYi0tZ0w9RjglKPSZNwyzFvwamEBU1hkYpNBoUDkcFR HahkohKp221SQuFWG/WfBt4l/FIrjGIOZ785V/mqjxbv+L3e///z31R99fCigHIFbIWP km70TMKtdN17Xbke5GM6LSMaKWxb0BIgfCz5iKtJk/B1ZMuZpq3hTEW8S7whrukh5e9q 7lS89ijOgcm2gNS+4yQFxZGONnADHZjkqab84G0seaPEIl8EvejELc9XDcYZpIgNv69i Io0y5jyeK2WUCCawiZowUmU9cZUFyKKb4XdBCB1APy7kaMG9PrVAXDjoTGQerk01Rur7 4bvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eiuI0tcvme5exQNNVfOAQbunvQ3LcYRWWzcDCecRy/Y=; b=lcJrej3Ey9MH5XlSjBg1w+vBcofHUroqbpAGoiyMZBsN+yq3RJW3dYYcW2qXSGdbzE dW02HBVYp2TEQd6aGW8Lnwp6SlJqzaWOfzNWMY8IZkFpqDjCYS7foMbuVU/pp3N1KSir atB4eBnj5ygq83Tl+Ql/Eejb5TZg7spnBb4XKyvfsuo5w3JMS9WrfiU9Ja+A93MtYz25 PqnfcUY+Ckv5TVMzWXCLsCCSzwLgG86nA0VmvCFnNrJl0Cqzb2fCCmSyFeFUjCJBerlQ qYYuj0j/56oyJ2OTS/BVgJtKyGAlLT5aEji29OiCQns2Fl/m/4OClh05wAyNrYogRvC0 6JSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h+m8qVM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si15928478ejj.71.2021.03.03.08.13.59; Wed, 03 Mar 2021 08:14:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h+m8qVM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346626AbhCAXto (ORCPT + 99 others); Mon, 1 Mar 2021 18:49:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:33656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239354AbhCASK4 (ORCPT ); Mon, 1 Mar 2021 13:10:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CEB765223; Mon, 1 Mar 2021 17:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619502; bh=AHhoX47dbvZrZ2Lzc7SWqJMv5zbkyEt9uqEW0+OYD6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h+m8qVM6ub9C5UcVwDSYmEKoD7CmshSiQ/QsJ3dVfnYO6GkArcMR66sXZMc9qjgqQ kYouTPhJrlbNq3oW5fK1869GGIM+SjT/IfKOC9D+SnKROHjIUelLG4innZ6WOXNBD8 XpzOmVfGKwZ4NsodQfatkViAhCA38U7u+/za3NUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Schmitz , Bartlomiej Zolnierkiewicz , Geert Uytterhoeven , Finn Thain , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 477/663] ide/falconide: Fix module unload Date: Mon, 1 Mar 2021 17:12:05 +0100 Message-Id: <20210301161205.461006134@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Finn Thain [ Upstream commit 07f1dc8cc85bbfb2f9270f25060c4755f4509f45 ] Unloading the falconide module results in a crash: Unable to handle kernel NULL pointer dereference at virtual address 00000000 Oops: 00000000 Modules linked in: falconide(-) PC: [<002930b2>] ide_host_remove+0x2e/0x1d2 SR: 2000 SP: 00b49e28 a2: 009b0f90 d0: 00000000 d1: 009b0f90 d2: 00000000 d3: 00b48000 d4: 003cef32 d5: 00299188 a0: 0086d000 a1: 0086d000 Process rmmod (pid: 322, task=009b0f90) Frame format=7 eff addr=00000000 ssw=0505 faddr=00000000 wb 1 stat/addr/data: 0000 00000000 00000000 wb 2 stat/addr/data: 0000 00000000 00000000 wb 3 stat/addr/data: 0000 00000000 00018da9 push data: 00000000 00000000 00000000 00000000 Stack from 00b49e90: 004c456a 0027f176 0027cb0a 0027cb9e 00000000 0086d00a 2187d3f0 0027f0e0 00b49ebc 2187d1f6 00000000 00b49ec8 002811e8 0086d000 00b49ef0 0028024c 0086d00a 002800d6 00279a1a 00000001 00000001 0086d00a 2187d3f0 00279a58 00b49f1c 002802e0 0086d00a 2187d3f0 004c456a 0086d00a ef96af74 00000000 2187d3f0 002805d2 800de064 00b49f44 0027f088 2187d3f0 00ac1cf4 2187d3f0 004c43be 2187d3f0 00000000 2187d3f0 800b66a8 00b49f5c 00280776 2187d3f0 Call Trace: [<0027f176>] __device_driver_unlock+0x0/0x48 [<0027cb0a>] device_links_busy+0x0/0x94 [<0027cb9e>] device_links_unbind_consumers+0x0/0x130 [<0027f0e0>] __device_driver_lock+0x0/0x5a [<2187d1f6>] falconide_remove+0x12/0x18 [falconide] [<002811e8>] platform_drv_remove+0x1c/0x28 [<0028024c>] device_release_driver_internal+0x176/0x17c [<002800d6>] device_release_driver_internal+0x0/0x17c [<00279a1a>] get_device+0x0/0x22 [<00279a58>] put_device+0x0/0x18 [<002802e0>] driver_detach+0x56/0x82 [<002805d2>] driver_remove_file+0x0/0x24 [<0027f088>] bus_remove_driver+0x4c/0xa4 [<00280776>] driver_unregister+0x28/0x5a [<00281a00>] platform_driver_unregister+0x12/0x18 [<2187d2a0>] ide_falcon_driver_exit+0x10/0x16 [falconide] [<000764f0>] sys_delete_module+0x110/0x1f2 [<000e83ea>] sys_rename+0x1a/0x1e [<00002e0c>] syscall+0x8/0xc [<00188004>] ext4_multi_mount_protect+0x35a/0x3ce Code: 0029 9188 4bf9 0027 aa1c 283c 003c ef32 <265c> 4a8b 6700 00b8 2043 2028 000c 0280 00ff ff00 6600 0176 40c0 7202 b2b9 004c Disabling lock debugging due to kernel taint This happens because the driver_data pointer is uninitialized. Add the missing platform_set_drvdata() call. For clarity, use the matching platform_get_drvdata() as well. Cc: Michael Schmitz Cc: Bartlomiej Zolnierkiewicz Fixes: 5ed0794cde593 ("m68k/atari: Convert Falcon IDE drivers to platform drivers") Reviewed-by: Geert Uytterhoeven Reviewed-by: Michael Schmitz Signed-off-by: Finn Thain Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ide/falconide.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ide/falconide.c b/drivers/ide/falconide.c index dbeb2605e5f6e..607c44bc50f1b 100644 --- a/drivers/ide/falconide.c +++ b/drivers/ide/falconide.c @@ -166,6 +166,7 @@ static int __init falconide_init(struct platform_device *pdev) if (rc) goto err_free; + platform_set_drvdata(pdev, host); return 0; err_free: ide_host_free(host); @@ -176,7 +177,7 @@ err: static int falconide_remove(struct platform_device *pdev) { - struct ide_host *host = dev_get_drvdata(&pdev->dev); + struct ide_host *host = platform_get_drvdata(pdev); ide_host_remove(host); -- 2.27.0