From: James Bottomley <jejb@linux.ibm.com>
To: Jiri Kosina <jikos@kernel.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Ding Hui <dinghui@sangfor.com.cn>,
Michal Kolar <mich.k@seznam.cz>
Subject: Re: [PATCH] scsi: ses: Handle enclosure with just a primary component gracefully
Date: Tue, 04 Apr 2023 16:26:08 -0400 [thread overview]
Message-ID: <fa174980e5c9bdafae3426fffe45b97b37f69c84.camel@linux.ibm.com> (raw)
In-Reply-To: <nycvar.YFH.7.76.2304042122270.29760@cbobk.fhfr.pm>
On Tue, 2023-04-04 at 21:23 +0200, Jiri Kosina wrote:
> From: Jiri Kosina <jkosina@suse.cz>
>
> This reverts 3fe97ff3d9493 ("scsi: ses: Don't attach if enclosure has
> no components") and introduces proper handling of case where there
> are no detected secondary components, but primary component
> (enumerated in num_enclosures) does exist. That fix was originally
> proposed by Ding Hui <dinghui@sangfor.com.cn>.
I think everything in here looks fine except this:
> --- a/drivers/scsi/ses.c
> +++ b/drivers/scsi/ses.c
> @@ -509,9 +509,6 @@ static int ses_enclosure_find_by_addr(struct
> enclosure_device *edev,
> int i;
> struct ses_component *scomp;
>
> - if (!edev->component[0].scratch)
> - return 0;
> -
> for (i = 0; i < edev->components; i++) {
> scomp = edev->component[i].scratch;
> if (scomp->addr != efd->addr)
If you remove the check, then scomp could be NULL here and we'll oops
on scomp->addr.
Regards,
James
next prev parent reply other threads:[~2023-04-04 20:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 19:23 Jiri Kosina
2023-04-04 20:26 ` James Bottomley [this message]
2023-04-04 21:41 ` [PATCH v2] " Jiri Kosina
2023-04-05 4:49 ` Ding Hui
2023-04-05 4:27 ` [PATCH] " Ding Hui
2023-04-09 22:38 ` Jiri Kosina
2023-04-12 2:03 ` 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=fa174980e5c9bdafae3426fffe45b97b37f69c84.camel@linux.ibm.com \
--to=jejb@linux.ibm.com \
--cc=dinghui@sangfor.com.cn \
--cc=jikos@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mich.k@seznam.cz \
/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
all inboxes | Powered by JetHome®