From patchwork Thu Mar 1 15:27:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130299 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2952959edc; Thu, 1 Mar 2018 07:38:59 -0800 (PST) X-Google-Smtp-Source: AG47ELuD2K27Bzh39qdYZrsBIoCo7Q4B9A+86EpS3ctZGiH6XBeL8hPUcrFCliWXoVpJgliZYgKT X-Received: by 10.98.210.70 with SMTP id c67mr2356136pfg.164.1519918739052; Thu, 01 Mar 2018 07:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918739; cv=none; d=google.com; s=arc-20160816; b=MvBxc33iozwfErkz48bLbQD02fqD1x/i5AbAI83CMLyjXkCvbU3Is31N6MMFca4Hav f0M3j3ipi7RzhYmVtZfRebPMfIihi7+yGSWpLdjO7Hq3nynR9pMxtzNthcpn8e0ArOqM 0JOnjMcXkqDf+c725FZYly6Ibj8yHJ88fUrcGF3OCMyqpJwOI1pumra9zv7VsKZ0lRP+ D7QhKUBIwaDTAkhVOAAY4QRoa1/a0wBCVag0WwLvclmer1VjcxjgGWIFoNlbUc4D37lM Q3I6VIdI73rR3KnwLRSDfor7c0UcVtzlkWLru+7JUBwkVjm378qMezcOOfuX263ErseZ WGqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ykr6FPWGH3sDEI03t5c8M6pzQz5iubebX4QNZxEBiKU=; b=CsC8/xAQu50BgS5NErzwupRpMfREdtxjtUGh4ALWlpRY3d8gBCesb+/Jzr5gotQEp8 txKXnJbPXlB6cAwTHTRRlc16aJCcC0aDnDRtSBAcDvzotPjLQd8vz6CLfWN0XJW/o3w1 x/IooL6ZnotD07UeaINYPjGhJMdduFHheVg1oQ0RIT6FdqAjHocgZN4BGHSt16kzbjIF EcCq1ikjwQU5fDGKIIFGMP1lhpCvMAq2A1Hwlw6hjU14im+QpyHNoYXi4dRo8QbjwPcX EvJuXVezOvKsxlQxOwsVtA+2u6u/pKieVLbwemEZQa3d+eC8PFOScLzWnJvThdpALpP6 PD0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=b8UfzcyU; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si2586092pgs.318.2018.03.01.07.38.58; Thu, 01 Mar 2018 07:38:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=b8UfzcyU; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032519AbeCAPi4 (ORCPT + 10 others); Thu, 1 Mar 2018 10:38:56 -0500 Received: from mail-bn3nam01on0130.outbound.protection.outlook.com ([104.47.33.130]:32096 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032570AbeCAPil (ORCPT ); Thu, 1 Mar 2018 10:38:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ykr6FPWGH3sDEI03t5c8M6pzQz5iubebX4QNZxEBiKU=; b=b8UfzcyU9c/yFhj+HogKLMjYWvkrSRmCuT17Qxo3E6iPA7ucErB1SfChr2l64ZlTIUFkZ+NPME+jg7zxP6E8d3NHqPn+whp1CKXFoWEiCnNBvzKYMIKXlobsSNOWx0/pfvhLr1BwpHnyt0bpLxqG71h5rgUin6zlscOZ5XFRoJQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0902.namprd21.prod.outlook.com (52.132.132.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:38:39 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:38:39 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Ben Skeggs , Sasha Levin Subject: [added to the 4.1 stable tree] drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized Thread-Topic: [added to the 4.1 stable tree] drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized Thread-Index: AQHTsXHSql4ccaaivUaOcFD7sNkjcw== Date: Thu, 1 Mar 2018 15:27:34 +0000 Message-ID: <20180301152116.1486-475-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0902; 7:K5MFIPkN9YTHu5EtWPKb8cD6x13NzOt/IsT34V6VgPnKYZsEANahbdVy1szqIcr7PT7jyd3CneXRWqjTybeDshsVW9H7Hs9NiuJVb/KoV+5zyHeHFY72qRRPbimUrmxhG+Mz+K/x+NKdgh2h1kQe0OBfXrQfy3BRZo0of6JVa5gjXZ46U+NQSvsZMsZN8P+NZPcS80/oeQt1zOj3SAz+ZvYnQDsT9eYoEBnUspjDWGrYlzAn4KgmBpt9iTy3wvDz x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: f4f2ef3b-0ecf-4f14-fe72-08d57f8a8159 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501229)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR2101MB0902; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0902; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(39380400002)(39860400002)(346002)(199004)(189003)(6116002)(72206003)(1076002)(3846002)(25786009)(2900100001)(36756003)(14454004)(316002)(3660700001)(6666003)(54906003)(110136005)(2950100002)(305945005)(7736002)(99286004)(5250100002)(86612001)(10090500001)(107886003)(66066001)(106356001)(2501003)(6512007)(6486002)(97736004)(6436002)(22452003)(68736007)(81166006)(8676002)(81156014)(53936002)(186003)(26005)(105586002)(3280700002)(8936002)(76176011)(478600001)(4326008)(10290500003)(575784001)(86362001)(5660300001)(2906002)(6506007)(102836004)(59450400001)(6346003)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0902; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: ln6hnr48NRkPwmvHpiEkBEhFLhrw75Cpt8gK5dHZu4l72hLIgxOH6tNbxkGKkfT3181JURL7G+YaJMHf4TP98zMqvCN+C2Od/pG2cg5uNHEjEfxTjlrW1usE6K+Mm8Ed6XHX8nKSUM8o80tM1w4oD2lxAUxDtArxVbkJBN6aHlw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <89B468D3E232BE46A96E3442AAB9B6F4@namprd21.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4f2ef3b-0ecf-4f14-fe72-08d57f8a8159 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:34.1159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0902 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit b74c0a9969f25217a5e5bbcac56a11bee16718d3 ] gcc-4.9 notices that the validate_init() function returns unintialized data when called with a zero 'nr_buffers' argument, when called with the -Wmaybe-uninitialized flag: drivers/gpu/drm/nouveau/nouveau_gem.c: In function ‘validate_init.isra.6’: drivers/gpu/drm/nouveau/nouveau_gem.c:457:5: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] However, the only caller of this function always passes a nonzero argument, and gcc-6 is clever enough to take this into account and not warn about it any more. Adding an explicit initialization to -EINVAL here is correct even if the caller changed, and it avoids the warning on gcc-4.9 as well. Signed-off-by: Arnd Bergmann Reviewed-By: Karol Herbst Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 58c959265b1a..36000f76e31d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -368,7 +368,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_device *dev = chan->drm->dev; int trycnt = 0; - int ret, i; + int ret = -EINVAL, i; struct nouveau_bo *res_bo = NULL; LIST_HEAD(gart_list); LIST_HEAD(vram_list);