qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] scsi: Remove SCSI_BUS macro


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] scsi: Remove SCSI_BUS macro
Date: Tue, 27 Nov 2012 09:24:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Il 27/11/2012 06:37, Lei Li ha scritto:
> As step behind Paolo's fix for RHBZ#879657 and according to the current
> fix in Commit b5007bc (hmp: do not crash on invalid SCSI hotplug), the
> macro SCSI_BUS has already been replaced to object_dynamic_cast which
> has been improved when try to cast to NULL value and it is also what
> DO_UPCAST macro does. And due to the potential Segmentation risk of
> SCSI_BUS, remove this macro.

The SCSI_BUS macro has a different purpose than object_dynamic_cast.
The NULL pointer change will also work with SCSI_BUS; the assertion
causes the bug in this particular case, but it is still useful in
general.  Whenever the assertion is fine, SCSI_BUS should be used
instead of DO_UPCAST.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]