public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: "Rodríguez Barbarin, José Javier" <JoseJavier.Rodriguez@duagon.com>
Cc: "jirislaby@kernel.org" <jirislaby@kernel.org>,
	"morbidrsa@gmail.com" <morbidrsa@gmail.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jth@kernel.org" <jth@kernel.org>,
	"Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>
Subject: Re: [PATCH v3 2/2] mcb: use short version for function pointer for mcb_free_bus
Date: Wed, 20 Sep 2023 15:18:51 +0200	[thread overview]
Message-ID: <2023092000-overprice-guileless-e1a3@gregkh> (raw)
In-Reply-To: <20230906114901.63174-3-JoseJavier.Rodriguez@duagon.com>

On Wed, Sep 06, 2023 at 11:49:28AM +0000, Rodríguez Barbarin, José Javier wrote:
> From: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
> 
> Just a style change so that the device release callbacks are defined
> in the same way for devices in mcb_bus and mcb_device.
> 
> Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
> Co-developed-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@duagon.com>
> Signed-off-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@duagon.com>
> ---
>  drivers/mcb/mcb-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
> index 0cac5bead84f..5c6157b0db75 100644
> --- a/drivers/mcb/mcb-core.c
> +++ b/drivers/mcb/mcb-core.c
> @@ -288,7 +288,7 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
>  	bus->dev.parent = carrier;
>  	bus->dev.bus = &mcb_bus_type;
>  	bus->dev.type = &mcb_carrier_device_type;
> -	bus->dev.release = &mcb_free_bus;
> +	bus->dev.release = mcb_free_bus;

But you aren't fixing the root cause here of an incorrect pointer being
passed to this function, right?

Yes, removing the single variable is nicer, so the crash doesn't happen,
but you are still passing the wrong pointer around, so why not fix that?

thanks,

greg k-h

  reply	other threads:[~2023-09-20 13:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 11:49 [PATCH v3 0/2] mcb: Fix crash mcb-core module is removed Rodríguez Barbarin, José Javier
2023-09-06 11:49 ` [PATCH v3 1/2] mcb: remove is_added flag from mcb_device struct Rodríguez Barbarin, José Javier
2023-09-06 11:49 ` [PATCH v3 2/2] mcb: use short version for function pointer for mcb_free_bus Rodríguez Barbarin, José Javier
2023-09-20 13:18   ` gregkh [this message]
2023-09-22 12:28     ` Rodríguez Barbarin, José Javier
2023-10-05  7:46       ` gregkh
2023-10-06 12:32         ` Rodríguez Barbarin, José Javier

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=2023092000-overprice-guileless-e1a3@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=Jorge.SanjuanGarcia@duagon.com \
    --cc=JoseJavier.Rodriguez@duagon.com \
    --cc=jirislaby@kernel.org \
    --cc=jth@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=morbidrsa@gmail.com \
    /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