[{"id":1766300,"web_url":"http://patchwork.ozlabs.org/comment/1766300/","msgid":"<3a258229-e3a0-04cf-bdc0-da4d1083999e@amsat.org>","list_archive_url":null,"date":"2017-09-10T16:56:59","subject":"Re: [Qemu-devel] [PATCH 1/5] spapr_pci: drop useless check in\n\tspapr_phb_vfio_get_loc_code()","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 09/09/2017 12:06 PM, Greg Kurz wrote:\n> g_strdup_printf() either returns a non-null pointer, either aborts\n> if it failed to allocate memory.\n> \n> Signed-off-by: Greg Kurz <groug@kaod.org>\n\nAcked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n\n> ---\n>   hw/ppc/spapr_pci.c |    4 ++--\n>   1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c\n> index d7880f257aa1..ef982f2ef370 100644\n> --- a/hw/ppc/spapr_pci.c\n> +++ b/hw/ppc/spapr_pci.c\n> @@ -766,7 +766,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb,  PCIDevice *pdev)\n>       /* Construct the path of the file that will give us the DT location */\n>       path = g_strdup_printf(\"/sys/bus/pci/devices/%s/devspec\", host);\n>       g_free(host);\n> -    if (!path || !g_file_get_contents(path, &buf, NULL, NULL)) {\n> +    if (!g_file_get_contents(path, &buf, NULL, NULL)) {\n>           goto err_out;\n>       }\n>       g_free(path);\n> @@ -774,7 +774,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb,  PCIDevice *pdev)\n>       /* Construct and read from host device tree the loc-code */\n>       path = g_strdup_printf(\"/proc/device-tree%s/ibm,loc-code\", buf);\n>       g_free(buf);\n> -    if (!path || !g_file_get_contents(path, &buf, NULL, NULL)) {\n> +    if (!g_file_get_contents(path, &buf, NULL, NULL)) {\n>           goto err_out;\n>       }\n>       return buf;\n> \n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GZWzPa29\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrT8M1FG0z9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 23:21:07 +1000 (AEST)","from localhost ([::1]:57703 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drOe9-0006Rf-1j\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 09:21:05 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56807)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1drOcR-0005Vu-E8\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 09:19:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1drOcQ-0001mF-Il\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 09:19:19 -0400","from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:37463)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1drOcH-0001gD-C7; Mon, 11 Sep 2017 09:19:09 -0400","by mail-qt0-x242.google.com with SMTP id u48so2654100qtc.4;\n\tMon, 11 Sep 2017 06:19:09 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tn12sm5878868qkn.83.2017.09.11.06.19.06\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Sep 2017 06:19:07 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=+CtAs3YElxH4/URz6Mu+vE6ghVsNEjBTC/0oSqD3xaQ=;\n\tb=GZWzPa29obxtdzwRqs8MJM9SVPcNzEqMF4FVF+cNSzZeRhhZbUJqvFpi5Ld5kuqZ3M\n\tuUeg67w2bhsTbpRTQoOgFFDhwF+zYEB5XpCct50odgOPL7GiRdOU7EzUOsdajwBZeF5/\n\tH4VNVQB+cionCbgAQpH/3t+NnhVYD+fY71wgjxJ36vl77vcp2TPhsiPpqYi4giEfU5hD\n\tVmEpbZPPccFbDrzudZPQLXBzBZ8HrDuPgdlbii6o3BX4bi8V7+zhB8OcqpNpPLh3O8Cr\n\tjaLDSf2g+RAWZzUNL3QTNTKDvnMs6uLAlw7gRgGHGmb3NGxknmmyLCWVHi79MxmyxrBn\n\tjetQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=+CtAs3YElxH4/URz6Mu+vE6ghVsNEjBTC/0oSqD3xaQ=;\n\tb=SrPiXwEzO6AHdi9rM/pZNS+8EsRx96RTHHCLdsB6T1b3T2b65wDqTm7ydOWfgQgSHl\n\tDQdY0SPZL2yJlIq+mgL8kOaFYHPg4hl3ep9/zisZpimpwUT086wrbYhp9f4dR6+0iRzB\n\t7O6Hol2NJlughrtCqQLQknBHcUPsamdQYHkkpzTe4miEj7FTRt7CXPHhhXQP0G9CS/+Q\n\tn4w/mzjZCCPvxK8kY+snXv6MBaR8LyppqNvUqxBq8yeibyQBtaw3g5VJyBEAMD8BOU5Q\n\tGMpbLVnF4eXoVAtvCeKOpEG70+9On0QZoIoNJJ1i4Qf8aZIOs/jnQI2SAWztPbJZSCSI\n\tmKwA==","X-Gm-Message-State":"AHPjjUiCqiSHbrEuivIos2/WSfrH5frrWkUSRDnKgVcE82aoA3TGxH8G\n\tZo/GCEQCyUHMQw==","X-Google-Smtp-Source":"AOwi7QCnX/MzT7e6Xclxus0o5KVgYGtmZPwloVFtuQkgXsmX0FZvFp+TUCdFmLWVsTdOiPAUpUuQ+Q==","X-Received":"by 10.200.56.252 with SMTP id g57mr15441238qtc.322.1505135948503;\n\tMon, 11 Sep 2017 06:19:08 -0700 (PDT)","To":"Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org","References":"<150496954641.9654.1998704077006846521.stgit@bahia>\n\t<150496956243.9654.5568893219758334324.stgit@bahia>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<3a258229-e3a0-04cf-bdc0-da4d1083999e@amsat.org>","Date":"Sun, 10 Sep 2017 13:56:59 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<150496956243.9654.5568893219758334324.stgit@bahia>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::242","Subject":"Re: [Qemu-devel] [PATCH 1/5] spapr_pci: drop useless check in\n\tspapr_phb_vfio_get_loc_code()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]