Philippe Mathieu-Daudé <[email protected]> writes:

> Cc'ing Markus
>
> On 11/2/21 17:33, Stefan Hajnoczi wrote:
>> Reported by Coverity (CID 1465222).
>> 
>> Fixes: 4a1d937796de0fecd8b22d7dbebf87f38e8282fd ("softmmu/qdev-monitor: add 
>> error handling in qdev_set_id")
>> Cc: Damien Hedde <[email protected]>
>> Cc: Kevin Wolf <[email protected]>
>> Cc: Michael S. Tsirkin <[email protected]>
>> Signed-off-by: Stefan Hajnoczi <[email protected]>
>> ---
>>  softmmu/qdev-monitor.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
>> index 4851de51a5..06f86a1a96 100644
>> --- a/softmmu/qdev-monitor.c
>> +++ b/softmmu/qdev-monitor.c
>> @@ -581,8 +581,8 @@ const char *qdev_set_id(DeviceState *dev, char *id, 
>> Error **errp)
>>          if (prop) {
>>              dev->id = id;
>>          } else {
>> -            g_free(id);
>>              error_setg(errp, "Duplicate device ID '%s'", id);
>> +            g_free(id);
>>              return NULL;
>>          }
>>      } else {
>> 
>
> Reviewed-by: Marc-André Lureau <[email protected]>
> Reviewed-by: Damien Hedde <[email protected]>

Reviewed-by: Markus Armbruster <[email protected]>


Reply via email to