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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C85CCD98C7 for ; Wed, 11 Oct 2023 06:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345376AbjJKGct (ORCPT ); Wed, 11 Oct 2023 02:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345233AbjJKGcp (ORCPT ); Wed, 11 Oct 2023 02:32:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9259B9B for ; Tue, 10 Oct 2023 23:32:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1AD1C433C7; Wed, 11 Oct 2023 06:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697005964; bh=Lb/42Qm3utcBiONCdOP5wqcXR9jQ63Q9gVfbicfEypU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FJ1y0hVjDY3aMOnoiWuOcOcILh7Na/FhtOBCP4aV1dJ2WYF5CGXwRrUS9WKTH2zd8 GfEInF+nvGrhVHoQVEP717m9aqO7DiugAnRHe0W18hMcInCXUvsmegElpfsxQwGeFN DgBUhXBcBWtWBc/FAdoR91bE5vQQ0N+02jkGrbFA= Date: Wed, 11 Oct 2023 08:32:40 +0200 From: Greg Kroah-Hartman To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: Re: [PATCH] misc/pvpanic: deduplicate comomn code Message-ID: <2023101113-squatter-stew-5d66@gregkh> References: <20231011-pvpanic-cleanup-v1-1-5c93b05ec331@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231011-pvpanic-cleanup-v1-1-5c93b05ec331@weissschuh.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 11, 2023 at 12:10:08AM +0200, Thomas Weißschuh wrote: > +int devm_pvpanic_probe(struct device *dev, void __iomem *base) > +{ > + struct pvpanic_instance *pi; > + int ret; > + > + if (!base) > + return -EINVAL; > + > + ret = devm_device_add_groups(dev, pvpanic_dev_groups); You just raced with userspace and lost :( Please just use the default groups attribute pointer, you should NEVER need to manually add groups to a device like this. And why are you calling this devm_*() for a probe function? That's risky as you are now in the global namespace and this really is not a devm_*() like function thanks, greg k-h