public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Myeonghun Pak <mhun512@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/bochs: Drop manual put on probe error path
Date: Fri, 24 Apr 2026 15:25:56 +0200	[thread overview]
Message-ID: <43bbfbcf-4a8d-4039-9ebf-24672b7e6d0a@suse.de> (raw)
In-Reply-To: <20260424123506.32275-1-mhun512@gmail.com>

Hi,

please add fixes tags to all these patches you're sending. You also need 
to CC stable so that they can be backported easily. Also list the AI 
you're using to find and create these patches.

Best regards
Thomas

Am 24.04.26 um 14:34 schrieb Myeonghun Pak:
> bochs_pci_probe() allocates the DRM device with devm_drm_dev_alloc(),
> which registers a devres action to drop the initial DRM device reference
> on driver detach or probe failure.
>
> The error path currently calls drm_dev_put() manually. If probe then
> returns an error, devres will run the registered release action and put
> the same device again, after the first put may already have released it.
>
> Return the probe error directly and let devres own the final put.
>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>   drivers/gpu/drm/tiny/bochs.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
> index 222e4ae1ab..5d8dc5efec 100644
> --- a/drivers/gpu/drm/tiny/bochs.c
> +++ b/drivers/gpu/drm/tiny/bochs.c
> @@ -761,25 +761,21 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent
>   
>   	ret = pcim_enable_device(pdev);
>   	if (ret)
> -		goto err_free_dev;
> +		return ret;
>   
>   	pci_set_drvdata(pdev, dev);
>   
>   	ret = bochs_load(bochs);
>   	if (ret)
> -		goto err_free_dev;
> +		return ret;
>   
>   	ret = drm_dev_register(dev, 0);
>   	if (ret)
> -		goto err_free_dev;
> +		return ret;
>   
>   	drm_client_setup(dev, NULL);
>   
>   	return ret;
> -
> -err_free_dev:
> -	drm_dev_put(dev);
> -	return ret;
>   }
>   
>   static void bochs_pci_remove(struct pci_dev *pdev)

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



  reply	other threads:[~2026-04-24 13:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 12:34 [PATCH] drm/bochs: Drop manual put on probe error path Myeonghun Pak
2026-04-24 13:25 ` Thomas Zimmermann [this message]
     [not found]   ` <CAGEsz8FrkbQEWZbxV3Q0NkSxhQka575uemKMQtTJQaCm44ByxQ@mail.gmail.com>
2026-04-24 14:59     ` Thomas Zimmermann
     [not found]       ` <CAGEsz8F54LaiJYGD6i-nW7hDiLTu6FOi4Z8fzb8b4=+9-OEH+Q@mail.gmail.com>
2026-05-04  8:36         ` Thomas Zimmermann
  -- strict thread matches above, loose matches on Subject: below --
2026-04-24 13:54 Myeonghun Pak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43bbfbcf-4a8d-4039-9ebf-24672b7e6d0a@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mhun512@gmail.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox