public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Olof Johansson <olof@lixom.net>,
	Desmond Yan <desmond.yan@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] misc: bcm-vk: unlock on error in bcm_to_h_msg_dequeue()
Date: Mon, 01 Feb 2021 17:31:17 +0000	[thread overview]
Message-ID: <cf899c97-2c26-afc4-f0ea-4976a074a05e@broadcom.com> (raw)
In-Reply-To: <YBfyb+jU5lDUe+5g@mwanda>



On 2021-02-01 4:22 a.m., Dan Carpenter wrote:
> Unlock before returning on this error path.
>
> Fixes: 111d746bb476 ("misc: bcm-vk: add VK messaging support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/misc/bcm-vk/bcm_vk_msg.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/bcm-vk/bcm_vk_msg.c b/drivers/misc/bcm-vk/bcm_vk_msg.c
> index eec90494777d..fc972e43258a 100644
> --- a/drivers/misc/bcm-vk/bcm_vk_msg.c
> +++ b/drivers/misc/bcm-vk/bcm_vk_msg.c
> @@ -849,7 +849,8 @@ s32 bcm_to_h_msg_dequeue(struct bcm_vk *vk)
>  				 * that is fatal.
>  				 */
>  				dev_crit(dev, "Kernel mem allocation failure.\n");
> -				return -ENOMEM;
> +				total = -ENOMEM;
> +				goto idx_err;
>  			}
>  
This is a pretty fatal case if we fail to allocate memory here.
Will let Desmond respond if we wanted to keep the mutex locked forever in this
case or if we do want to return and keep mutex locked if it is fatal and there is
no real recovery path.
>  			/* flush rd pointer after a message is dequeued */

  reply	other threads:[~2021-02-01 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 12:22 [PATCH] misc: bcm-vk: unlock on error in bcm_to_h_msg_dequeue() Dan Carpenter
2021-02-01 17:31 ` Scott Branden [this message]
2021-02-01 18:31   ` Desmond Yan
2021-02-01 18:32 ` Desmond Yan
2021-02-01 22:49   ` Scott Branden

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=cf899c97-2c26-afc4-f0ea-4976a074a05e@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.carpenter@oracle.com \
    --cc=desmond.yan@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    /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