Message ID | 1515756676-3860-26-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show
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; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nhtqGFdK"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJ16H3VGFz9s7n for <incoming@patchwork.ozlabs.org>; Fri, 12 Jan 2018 22:41:11 +1100 (AEDT) Received: from localhost ([::1]:35238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1eZxht-0006lz-H2 for incoming@patchwork.ozlabs.org; Fri, 12 Jan 2018 06:41:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1eZxYs-0007XQ-Vi for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1eZxYs-0005Qw-4J for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:50 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:38108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1eZxYr-0005Ol-UJ for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:50 -0500 Received: by mail-wr0-x241.google.com with SMTP id x1so857787wrb.5 for <qemu-devel@nongnu.org>; Fri, 12 Jan 2018 03:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eP8gLKdjr9LJG1Q7q7ujTcqRzIXaqHbCyeQ33t1MCeE=; b=nhtqGFdKjd2+AWYfUWzU4M6PTxzEzXCfCAeDRtaJud/HxWAX+eUtelFor6gCNGImAF VvYUiXAXoteZyb6SCHAmpchW0/KYTIUakKA007RZKMFNPvMMAOXG2mx85WvrXBLnQq3U on9slNbxzy6EkISpdMCmVJlcAes3CbsljOS1wXkEnTKUdl3uAIA5s4+sTdMoKbsjsYRI GMlw9OE5ZMFHu+74Dw7MpMfhMaFgqcGvuDLCZ7zdP9Q3xJcHoOkFWl2CFM4PM5LvW5b2 VgdvDPi6mUBYmyiGvf2M6JCmE6nfRgEYceGgDsEoPehtA1Tak7M5gL+Ud25SjKWHQmyI RKjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eP8gLKdjr9LJG1Q7q7ujTcqRzIXaqHbCyeQ33t1MCeE=; b=Jhdr7ayqS/Lw1lyvYKQik0HTFgNhAjrO97FrcoAT9NW1Puq491NlQoU78iUVSX++9a GO2V40a1MSD38uWT/ewZswGk49TCXoSQrJhUpg0WiBcx5fmKAKGWONQMSVz2pE93Pxp7 8XRz7s16MptITd/Wepud65ZznNIkVxU1gN4cUIZgIwZR9WNkqscSm9jj1GQyud33NSx2 zsn4VFGyzddDXArVgqFHDlcDy7CAl096jQh5RcktHXXGLzg+hc5UBI+I66/vX8El5LEx 4iWIISj5FEhDctWnlkqFeaxcec67wYGEVDUsbFnBvR23bwnROT4/GFbijNE98V1u5h9V UsFw== X-Gm-Message-State: AKGB3mK7WLRU3m3H/THkYnqj+TfI+eG7Iqf6lb1xa4wrrk+w+MD4cSv8 f9NM7PfEEFjq7btpSG77CrYfVUiL X-Google-Smtp-Source: ACJfBou+sGe3Bp+w9+v5yxYuaOvEYvME0Ai3f59GM40jo3efPdNpacFFTVoIrjd+T5lN3pWGUYExnw== X-Received: by 10.223.160.139 with SMTP id m11mr22577329wrm.119.1515756708530; Fri, 12 Jan 2018 03:31:48 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-229-84.clienti.tiscali.it. [78.12.229.84]) by smtp.gmail.com with ESMTPSA id l8sm2732271wmg.46.2018.01.12.03.31.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 03:31:47 -0800 (PST) From: Paolo Bonzini <pbonzini@redhat.com> To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 12:30:49 +0100 Message-Id: <1515756676-3860-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> References: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 25/52] mips: fix potential fopen(NULL,...) 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>, <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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
[PULL,01/52] scsi-generic: Add share-rw option
|
expand
|
diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c index 57d5ab2..ad7345f 100644 --- a/hw/nvram/ds1225y.c +++ b/hw/nvram/ds1225y.c @@ -80,7 +80,7 @@ static int nvram_post_load(void *opaque, int version_id) } /* Write back nvram contents */ - s->file = fopen(s->filename, "wb"); + s->file = s->filename ? fopen(s->filename, "wb") : NULL; if (s->file) { /* Write back contents, as 'wb' mode cleaned the file */ if (fwrite(s->contents, s->chip_size, 1, s->file) != 1) { @@ -126,7 +126,7 @@ static int nvram_sysbus_initfn(SysBusDevice *dev) sysbus_init_mmio(dev, &s->iomem); /* Read current file */ - file = fopen(s->filename, "rb"); + file = s->filename ? fopen(s->filename, "rb") : NULL; if (file) { /* Read nvram contents */ if (fread(s->contents, s->chip_size, 1, file) != 1) {