public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Enze Li <lienze@kylinos.cn>
Cc: jejb@linux.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: sr: add handling of memory allocation failure in get_capabilities
Date: Tue, 26 Apr 2022 08:46:17 -0400	[thread overview]
Message-ID: <yq1ilqwt3ml.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20220413100008.522912-1-lienze@kylinos.cn> (Enze Li's message of "Wed, 13 Apr 2022 18:00:08 +0800")


Enze,

> @@ -669,8 +669,9 @@ static int sr_probe(struct device *dev)
>  
>  	sdev->sector_size = 2048;	/* A guess, just in case */
>  
> -	/* FIXME: need to handle a get_capabilities failure properly ?? */
> -	get_capabilities(cd);
> +	error = -ENOMEM;
> +	if (get_capabilities(cd))
> +		goto fail_put;

Shouldn't this be 'goto fail_minor;'?

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2022-04-26 12:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 10:00 [PATCH] scsi: sr: add handling of memory allocation failure in get_capabilities Enze Li
2022-04-26 12:46 ` Martin K. Petersen [this message]
2022-04-27  3:03   ` Enze Li
2022-04-27  2:56 ` [PATCH v2] scsi: sr: add handling of memory allocation failures when calling get_capabilities Enze Li
2022-04-28  2:30   ` Martin K. Petersen
2022-05-03  0:51   ` Martin K. Petersen

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=yq1ilqwt3ml.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=jejb@linux.ibm.com \
    --cc=lienze@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox