All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Chen-Yu Tsai <wenst@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: hub: Set proper message when usb_hub_create_port_device() fails
Date: Mon, 10 Aug 2026 19:31:28 +0300	[thread overview]
Message-ID: <ann84DKCXCPLtgeX@ashevche-desk.local> (raw)
In-Reply-To: <20260728100005.413868-1-wenst@chromium.org>

On Tue, Jul 28, 2026 at 06:00:04PM +0800, Chen-Yu Tsai wrote:
> Right now when usb_hub_create_port_device() fails, it prints a separate
> error message to say which port failed, but otherwise leaves 'message'
> set to the default "out of memory", which is somewhat misleading.
> 
> Allocate some memory and put the currently separate error message in
> it, and use it as the error message. If the allocation fails, use a
> generic version of the error message. The allocation uses devres
> helpers, and will be freed after the message is printed and the device
> is cleaned up.

The 'message' is local to the function, why devm?
Shouldn't __free() be sufficient?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-08-10 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 10:00 [PATCH] usb: hub: Set proper message when usb_hub_create_port_device() fails Chen-Yu Tsai
2026-08-10 16:31 ` Andy Shevchenko [this message]
2026-08-11  3:51   ` Chen-Yu Tsai
2026-08-11  7:14     ` Andy Shevchenko

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=ann84DKCXCPLtgeX@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wenst@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.