mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Avoid segfault in the 'smpphylist' subcommand.
Initialize devlist.dev_queue tail queue early enough before its any potential traversal in freebusdevlist() when in smpphylist error path. Reported by: Pavel Polyakov <bsd kobyla org> (on irc) Reviewed by: ken MFC after: 5 days
This commit is contained in:
parent
79b5235666
commit
affe7c8f84
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239468
@ -5459,6 +5459,7 @@ smpphylist(struct cam_device *device, int argc, char **argv,
|
||||
|
||||
bzero(&(&ccb->ccb_h)[1],
|
||||
sizeof(union ccb) - sizeof(struct ccb_hdr));
|
||||
STAILQ_INIT(&devlist.dev_queue);
|
||||
|
||||
rgrequest = malloc(sizeof(*rgrequest));
|
||||
if (rgrequest == NULL) {
|
||||
@ -5527,7 +5528,6 @@ smpphylist(struct cam_device *device, int argc, char **argv,
|
||||
goto bailout;
|
||||
}
|
||||
|
||||
STAILQ_INIT(&devlist.dev_queue);
|
||||
devlist.path_id = device->path_id;
|
||||
|
||||
retval = buildbusdevlist(&devlist);
|
||||
|
Loading…
Reference in New Issue
Block a user