Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3613467imm; Wed, 5 Sep 2018 03:08:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYxf7RlfdUpJxd3feHKY7w6ohr3JwIc2/MIDsDZfLcI1ZzjpDoFCDn8MutjP1ymaBRidQDt X-Received: by 2002:a65:5a81:: with SMTP id c1-v6mr35317234pgt.120.1536142107581; Wed, 05 Sep 2018 03:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536142107; cv=none; d=google.com; s=arc-20160816; b=dGBQCtrcyhpN2II91AdgmqqXXAe7P73bkjapvtXk7yB9rOkbUpx+XWhatqS+d54tRi 8B3uv8OS9WRdV4i04EHtxK3JK9y9UhyolYtCQyMbTCVm8CcsLNK0DDmBehsMX1h6/n2x 3yrQsrNWpAP+0anwpC7g0HcaWraoQuiKzdc+TxgLBPteo6v/SFQKHNX1YsHQWTVh6w/K I16a3yA+WQzEGe2AUEYi+hH077tHWzM2g+2tr74QGByPZDOswWXO8M5hTJ9S5lx0hfJC eZqipFIX1++h6OitZQAWfS7eXaUzS4Lu8QQjtgwoe0magaqZHTEen/dkVJNoK3NA9b+J bS2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=agwIkkJGKZ5QCvYxyp0jTV+U1emY9uV+w5UeFRb43Tk=; b=TszZEl/Ny/dUbJc7CLVOHGH62ipIZ78uSO563UY4miEtkpamU/HGRZa3IqpOa5G49R BWwcOZnoAtEl+Hdff+UjGyzGWhQDcjFXaM/dMKj/7YiD+q3iBeE1zOv47x0V6dEEF8Yx KM2xlr/zSgyaU2qhWDvm3K8o+nLNzSHMtTWoHj6D+Yar130fUZePEYsJN+/6fbKKrXLd 9ufWudrP16njZL9w32IT+IoQTH4KSYwWmA9qTWilzIpAZ+ktmbvToNXXA6Ygw1vR5ZS3 AhguPSIg3JOzlwwWDOlFYvjSUYJVHwqYyPTjlTRLrqGXeqpBM76y1ZB6y4SHGgQvZj7n FSfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5-v6si1521750plh.18.2018.09.05.03.08.11; Wed, 05 Sep 2018 03:08:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727629AbeIEOg2 (ORCPT + 99 others); Wed, 5 Sep 2018 10:36:28 -0400 Received: from webbox1416.server-home.net ([77.236.96.61]:57542 "EHLO webbox1416.server-home.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726249AbeIEOg2 (ORCPT ); Wed, 5 Sep 2018 10:36:28 -0400 Received: from imapserver.systec-electronic.com (unknown [212.185.67.146]) by webbox1416.server-home.net (Postfix) with ESMTPA id ABF1F27A61F; Wed, 5 Sep 2018 12:06:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by imapserver.systec-electronic.com (Postfix) with ESMTP id 88AB81A1B50; Wed, 5 Sep 2018 12:06:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at imapserver.systec-electronic.com Received: from imapserver.systec-electronic.com ([127.0.0.1]) by localhost (imapserver.systec-electronic.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mHa9MnFhaHze; Wed, 5 Sep 2018 12:06:55 +0200 (CEST) Received: from ws-140106.localnet (ws-140106.systec.local [192.168.10.92]) by imapserver.systec-electronic.com (Postfix) with ESMTPA id B0B741A1B4F; Wed, 5 Sep 2018 12:06:55 +0200 (CEST) From: Alexander Stein To: Colin King Cc: Greg Kroah-Hartman , Christian Gromm , Abdun Nihaal , devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: most: video: fix registration of an empty comp core_component Date: Wed, 05 Sep 2018 12:06:55 +0200 Message-ID: <1588498.TolbaFeo5X@ws-140106> In-Reply-To: <20180905094605.14827-1-colin.king@canonical.com> References: <20180905094605.14827-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, September 5, 2018, 11:46:05 AM CEST Colin King wrote: > From: Colin Ian King > > Currently we have structrues comp (which is empty) and comp_info being > used to register and deregister the component. This mismatch in naming > occurred from a previous commit that renamed aim_info to comp. Fix this > to use consistent component naming in line with most/net, most/sound etc. > > This fixes the message two issues, one with a null empty name when > loading the module: > > [ 1485.269515] most_core: registered new core component (null) > > and an Oops when removing the module: > > [ 1485.277971] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 > [ 1485.278648] PGD 0 P4D 0 > [ 1485.279253] Oops: 0002 [#2] SMP PTI > [ 1485.279847] CPU: 1 PID: 32629 Comm: modprobe Tainted: P D WC OE 4.18.0-8-generic #9 > [ 1485.280442] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 > [ 1485.281040] RIP: 0010:most_deregister_component+0x3c/0x70 [most_core] > .. etc > > Fixes: 1b10a0316e2d ("staging: most: video: remove aim designators") > Signed-off-by: Colin Ian King > --- > drivers/staging/most/video/video.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c > index cf342eb58e10..ad7e28ab9a4f 100644 > --- a/drivers/staging/most/video/video.c > +++ b/drivers/staging/most/video/video.c > @@ -530,7 +530,7 @@ static int comp_disconnect_channel(struct most_interface *iface, > return 0; > } > > -static struct core_component comp_info = { > +static struct core_component comp = { > .name = "video", > .probe_channel = comp_probe_channel, > .disconnect_channel = comp_disconnect_channel, Doesn't it make more sense to move that variable defintion where currently the forward declaration is? This way you can't have 2 variables accidentally. You will need forward declarations for those two functions, but a mismatch here results in a linker error rather than a runtime NULL pointer access Best regards, Alexander