From patchwork Wed Dec 13 01:58:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121700 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4884575qgn; Tue, 12 Dec 2017 18:00:37 -0800 (PST) X-Google-Smtp-Source: ACJfBotUyf7I6/1RK1s60tjwJV19Clqwq1ttvK9Evxg5iSacXasK0Wcv89YWavG6oa18UDFsPH+t X-Received: by 10.84.246.197 with SMTP id j5mr4293233plt.168.1513130437160; Tue, 12 Dec 2017 18:00:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513130437; cv=none; d=google.com; s=arc-20160816; b=ttt2KerYYnrEswc3oXK59ZCUKPdAjLC3ytV+pI8qbb2HzUA/8swT4bEPk5tR/ULCR8 UXJMe1vMx9JHVuPj3OjnOstxskhPWXeo9MuWZtImX0SSZP3lPZBzXi4UeL8RkDM0tEj0 ZikE7Le2T4TxWsudPjhiHmhVa2RzxhEXK2fIsiGMWhxEJtYdyqn41aW/FpWmivr3Y1BL PA/eJXu4jEU8oGIoOderYhzPNImaZKpw7OTSHFzzX53En1TJP8Vxjb3/KumPWAbXp+6v SPv8hKzvrJVkEyaz7epa66yANencNDNilTxaS8YzCjqy3jMXYyP4Kn62nyJdGFvGtqjZ DztA== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=VKcUfz1ia4idFefQJWoqYNcdD2GkcOFdjbdLY19FhQU=; b=lmHbMNj7W2gaXNKIA8LNiCDN5qJuDpZ4DVgQjtVsbnfbg58HbTrSMIhEc2aem5KesV URUIpzK9c90gNmQpwX8NN1/e9rgQM/Jm82E4HMLh7dfH4/QuPVCWvIDqEFTb95v3zOZy 89cLDgnzd4mg6JOBi8k3qnLGq1D7fFy+NShr5ocqCbOVSEXtSAet0dmG7zC2ylvnGrzf sWn+sAtKCUGwEVqkttEJ9FyA3uk2L6Ps5K2PMURGpQEBUyLXINrOtuNPnVqKcQ0s2c1S CmvDR+LeMNNyPtqr5yDVbPsJZQf30g+AFHzKjZ2i5l/wlYWoE1kzmxYIX3kJHSC2A2Rr pRmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=HDSQZQXW; dkim=fail header.i=@verizon.com header.s=corp header.b=qG1+P/XI; dkim=fail header.i=@verizon.com header.s=corp header.b=BAYXCYbc; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si400804pgp.181.2017.12.12.18.00.36; Tue, 12 Dec 2017 18:00:37 -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=fail header.i=@verizon.com header.s=corp header.b=HDSQZQXW; dkim=fail header.i=@verizon.com header.s=corp header.b=qG1+P/XI; dkim=fail header.i=@verizon.com header.s=corp header.b=BAYXCYbc; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752951AbdLMCAf (ORCPT + 10 others); Tue, 12 Dec 2017 21:00:35 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:35576 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297AbdLMCA3 (ORCPT ); Tue, 12 Dec 2017 21:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130429; x=1544666429; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=heb6R2cmPQc+YGUc/+76JrfPTAdHAoRZI990hDokSHs=; b=HDSQZQXWhMdmO9QQsS8eAsjuoA2JJiQ+amgcf+j64iCfwNEU3VOG2Hcz lkoxFzXbjf0kuowm03v/WNJrXZdrmoGoKjNVbFMEhNWIw7QpH+xIph8SU q2jVFqYCeoQdy+U2wC6A+J3VkwQC/QBzbpiqbUohUyO65k83Ua18daq/X o=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 13 Dec 2017 02:00:19 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2017 02:00:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130402; x=1544666402; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=heb6R2cmPQc+YGUc/+76JrfPTAdHAoRZI990hDokSHs=; b=qG1+P/XIUeHuh5f9XuDzB0oB0Tzb7oWZXYF4hsGIYI7at5epO0njnqQE NLoOU2jW69VL5SlDEFygKNtVT3aaJWrY9tt6rk9/AB0GM8sq9mL32jZjV ZWma7D6CQT3sl7HW8oM3SXVv9FQWvEuPJEP4gRR+CSAqRywg7i1qqa/s/ 8=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Dec 2017 21:00:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130401; x=1544666401; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=heb6R2cmPQc+YGUc/+76JrfPTAdHAoRZI990hDokSHs=; b=BAYXCYbcOuYMW45yAmq4/+q6j+LC5TEd6jlnfbFXg3UDlY0onWGI8S7x 7KmU9m5vTfOWkNYAIrQZqpAXUvd9IIilhRZe++EKK0rg4i5U9nlDv2jKU /48q/lGJGs3G6JH4kfXiVq7ZS/7RsAtcnJHgUtKqvaW9e7S+l86BgAZAP Q=; From: alexander.levin@verizon.com Cc: Arnd Bergmann , Guenter Roeck , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 13 Dec 2017 02:00:01 +0000 Received: from tbwexch05apd.uswin.ad.vzwcorp.com (153.114.162.29) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Dec 2017 21:00:01 -0500 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by tbwexch05apd.uswin.ad.vzwcorp.com (153.114.162.29) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 21:00:00 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 19:59:59 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Tue, 12 Dec 2017 19:59:59 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.4 21/59] hwmon: (asus_atk0110) fix uninitialized data access Thread-Topic: [PATCH AUTOSEL for 4.4 21/59] hwmon: (asus_atk0110) fix uninitialized data access Thread-Index: AQHTc7Xg5D7K/IWdcU6pQQKrl0IEAQ== Date: Wed, 13 Dec 2017 01:58:31 +0000 Message-ID: <20171213015817.6950-21-alexander.levin@verizon.com> References: <20171213015817.6950-1-alexander.levin@verizon.com> In-Reply-To: <20171213015817.6950-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit a2125d02443e9a4e68bcfd9f8004fa23239e8329 ] The latest gcc-7 snapshot adds a warning to point out that when atk_read_value_old or atk_read_value_new fails, we copy uninitialized data into sensor->cached_value: drivers/hwmon/asus_atk0110.c: In function 'atk_input_show': drivers/hwmon/asus_atk0110.c:651:26: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] Adding an error check avoids this. All versions of the driver are affected. Fixes: 2c03d07ad54d ("hwmon: Add Asus ATK0110 support") Signed-off-by: Arnd Bergmann Reviewed-by: Luca Tettamanti Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/hwmon/asus_atk0110.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.11.0 diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index cccef87963e0..975c43d446f8 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -646,6 +646,9 @@ static int atk_read_value(struct atk_sensor_data *sensor, u64 *value) else err = atk_read_value_new(sensor, value); + if (err) + return err; + sensor->is_valid = true; sensor->last_updated = jiffies; sensor->cached_value = *value; From patchwork Wed Dec 13 01:58:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121709 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4902891qgn; Tue, 12 Dec 2017 18:22:43 -0800 (PST) X-Google-Smtp-Source: ACJfBouhY3Da5QblnIOP7qoc4kj7QvLAuoI0dt+lcX4C0yoAvrJ1nrj2MBHxIuXXrq82cyfIYDR7 X-Received: by 10.159.231.20 with SMTP id w20mr4440398plq.398.1513131763114; Tue, 12 Dec 2017 18:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513131763; cv=none; d=google.com; s=arc-20160816; b=Rkx58ynOzvcfw3Cxk3eggkKbCbnIUz8d26QwMM7ypaHkJJf/QKnQoTEaNQtT9LXBEY zzXRkAshHMqozbriBNhFzkelxf5d8b3VOBQe0il4kUSMpVl14qLFK7M3Pt0yCWfmOW8c WRqqgr6xQAKFfXgE1WAUx7Oz46ck4ZXxeRsjp8Aqr4boy5cjK1luQPSSM6bfvJQYXPty XMFFg82hH7Te6Q+dCH+MnLzaQd1infVfIX7+F7phZCuxogURjoU0joQOB4CeMi4BtMg9 E6e0kkRbl1d15fnd9hWnI5Fu0wgfWbb5sBp18Eo7uK5t/vpwlPaCxhgABvGL59NlLIIe KUog== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=WAJGm+Iup1+AYy1oyptKTKMcbqWrP641kbpW5aNRY5w=; b=x3wD/vdGysxxSCIJe465hiz0FoBPzQIIboWkucSAqwlC+4Ccgc5p6mpxI5dJCmLptt B1pwgxvMdYuX2OMz3gRxNxxqj0/cubPv0Dy5128Qi3yvX9aPto0rE7+yUAZDbNefk3zD 6ImMrBfUNa8hqPKvBe0n4srisMKizh0094CqW7O5/TkH/DIBmlSy+TPgB9MAiDw3NmbS 7ZVVuxySUx7b/sBlxDlQCfg0P/ml30hkdA05IvOFBMZ35JrZq2Jvbmx6IkBg2h715Dgf sz7ikB6+Kr9pcGZfWEHr555tO6uXsRtHLcNwK9eo8TaxtAsOjL+hdYvo75Xu9BYbiurY LNDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=gKEtKVtJ; dkim=fail header.i=@verizon.com header.s=corp header.b=kJRXKN3d; dkim=fail header.i=@verizon.com header.s=corp header.b=H7LF2m2b; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si430830pgc.226.2017.12.12.18.22.42; Tue, 12 Dec 2017 18:22:43 -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=fail header.i=@verizon.com header.s=corp header.b=gKEtKVtJ; dkim=fail header.i=@verizon.com header.s=corp header.b=kJRXKN3d; dkim=fail header.i=@verizon.com header.s=corp header.b=H7LF2m2b; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753583AbdLMCWl (ORCPT + 10 others); Tue, 12 Dec 2017 21:22:41 -0500 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:11025 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753587AbdLMCAj (ORCPT ); Tue, 12 Dec 2017 21:00:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130439; x=1544666439; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=kyfTk0xptnKovUAbh25eW8Z3YBWwMC5k3zkFKFOIBo4=; b=gKEtKVtJWQ7BRB4bkBoz467my8NavUd7Sn067RmLUdWY+mjLO3NWe9ml bhTTd+WbEj9nV+q5Ik6aO0fTPq1Oyuw2piUhgO1B0ViczGy9Wa9++IJZB htRRv9bgQy78q1Hd5w4Z8+/qc+4/Gpa6HnohpgFjZW4IOyDtUSk/w8KxP A=; Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by omzsmtpe02.verizonbusiness.com with ESMTP; 13 Dec 2017 02:00:36 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi02.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2017 02:00:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130404; x=1544666404; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=kyfTk0xptnKovUAbh25eW8Z3YBWwMC5k3zkFKFOIBo4=; b=kJRXKN3d2m98RzBHfnHCuzcKu3Og6hRCJusYvFkzGFSRh66hoUfY5vZ9 9qy2jb5j3RTConKdmBG+NUBO74JL9uM8ne6X+DfXweqwoaX7jGvXNnMnD s7uKeGN4AAmWsyMyTYprcBIzKKOo3AbWDdG5JYgdt28fQSX5cR6YNrOcZ 4=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Dec 2017 21:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130404; x=1544666404; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=kyfTk0xptnKovUAbh25eW8Z3YBWwMC5k3zkFKFOIBo4=; b=H7LF2m2b95Fowm+LoVoc/oTQztbU1is2iFl3k11BzAa0d+sD3MMREfBo Nct0TPoKhhkH8JfKYufU3DEH4UCmZLVKkv+6xyEEWHwDfkTKA1q+YiDjR mIyLgXoiMWJ6brxBekKs1Iy7hbch2ijTGaopPty2UHUIH9MNXPXsy02pj M=; From: alexander.levin@verizon.com Cc: Arnd Bergmann , "David S . Miller" , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 13 Dec 2017 02:00:04 +0000 Received: from tbwexch28apd.uswin.ad.vzwcorp.com (153.114.162.52) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Dec 2017 21:00:04 -0500 Received: from OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) by tbwexch28apd.uswin.ad.vzwcorp.com (153.114.162.52) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 21:00:03 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 20:00:02 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Tue, 12 Dec 2017 20:00:02 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.4 26/59] bna: avoid writing uninitialized data into hw registers Thread-Topic: [PATCH AUTOSEL for 4.4 26/59] bna: avoid writing uninitialized data into hw registers Thread-Index: AQHTc7XgXMLC5bw7l0K7RTyRUkHkLg== Date: Wed, 13 Dec 2017 01:58:32 +0000 Message-ID: <20171213015817.6950-26-alexander.levin@verizon.com> References: <20171213015817.6950-1-alexander.levin@verizon.com> In-Reply-To: <20171213015817.6950-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit a5af83925363eb85d467933e3d6ec5a87001eb7c ] The latest gcc-7 snapshot warns about bfa_ioc_send_enable/bfa_ioc_send_disable writing undefined values into the hardware registers: drivers/net/ethernet/brocade/bna/bfa_ioc.c: In function 'bfa_iocpf_sm_disabling_entry': arch/arm/include/asm/io.h:109:22: error: '*((void *)&disable_req+4)' is used uninitialized in this function [-Werror=uninitialized] arch/arm/include/asm/io.h:109:22: error: '*((void *)&disable_req+8)' is used uninitialized in this function [-Werror=uninitialized] The two functions look like they should do the same thing, but only one of them initializes the time stamp and clscode field. The fact that we only get a warning for one of the two functions seems to be arbitrary, based on the inlining decisions in the compiler. To address this, I'm making both functions do the same thing: - set the clscode from the ioc structure in both - set the time stamp from ktime_get_real_seconds (which also avoids the signed-integer overflow in 2038 and extends the well-defined behavior until 2106). - zero-fill the reserved field Fixes: 8b230ed8ec96 ("bna: Brocade 10Gb Ethernet device driver") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/brocade/bna/bfa_ioc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c index 9e59663a6ead..0f6811860ad5 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c @@ -1930,13 +1930,13 @@ static void bfa_ioc_send_enable(struct bfa_ioc *ioc) { struct bfi_ioc_ctrl_req enable_req; - struct timeval tv; bfi_h2i_set(enable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_ENABLE_REQ, bfa_ioc_portid(ioc)); enable_req.clscode = htons(ioc->clscode); - do_gettimeofday(&tv); - enable_req.tv_sec = ntohl(tv.tv_sec); + enable_req.rsvd = htons(0); + /* overflow in 2106 */ + enable_req.tv_sec = ntohl(ktime_get_real_seconds()); bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req)); } @@ -1947,6 +1947,10 @@ bfa_ioc_send_disable(struct bfa_ioc *ioc) bfi_h2i_set(disable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_DISABLE_REQ, bfa_ioc_portid(ioc)); + disable_req.clscode = htons(ioc->clscode); + disable_req.rsvd = htons(0); + /* overflow in 2106 */ + disable_req.tv_sec = ntohl(ktime_get_real_seconds()); bfa_ioc_mbox_send(ioc, &disable_req, sizeof(struct bfi_ioc_ctrl_req)); } From patchwork Wed Dec 13 01:58:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121711 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4904845qgn; Tue, 12 Dec 2017 18:25:17 -0800 (PST) X-Google-Smtp-Source: ACJfBosIG/skMIiqgImC4C1p4Z8ijsUqBDItjYINfMkoDyb0tZ+51+lB6aVtKeCY2SVvaFUJZHvv X-Received: by 10.98.253.3 with SMTP id p3mr4432027pfh.20.1513131917645; Tue, 12 Dec 2017 18:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513131917; cv=none; d=google.com; s=arc-20160816; b=RnovK2e+GnnWZ85mLtAQvE1MwY8I9jJewS0OKNCcJd/dqFzs5nzgbXyFK2+Yr+FCO6 SabH8VWDFo5t3I8kb+suxaJujC0MP/eCj7o3hQfvl2kQPFAj57cKq5a13IIJkH1FQc79 0EN6stZrd8wTEfOVutN7eb/s0PhZM017eucT6jy8Ssq9lcenx6mA8zBD76xrNm2K/jtB bYcazcm5bfl/3wUNUaZ8+Wjs1Jmf3hcwCmcP1sCw9FqkFIC0BAaZY954eiMBLaovx7/G vkhUjA6zcQtgUwfNqpnS8bVOf179cTLMEsVxRkLi4LqGb36E36RSXEcy7Y8mol8s7lbs 8WUA== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=BX5O1kCtgMUSinHmH6Wo09giKmsRd/3yspP1gxRubX4=; b=cmyiFBrTJnfs+3CowJMgiWoE92fYPpbaFrcyldPvQjsK1/s64YU4j0H6vTEF+pJH7d kwcFI1bNtxxbRjFNR3Q3BtuM8khxHMkauiPyr2drG2GhY04l4A5fXzx0uqn/THzNNJzz a0D68JkTRnKZ/z4IiN9srJ9WQaARbvVXFGuqmz/HsHzqd+dcRywnoabnFps83qvf0HqT DooMX5+FzFOl48YDHikzR3mLBY+5lxArfX7aP24cniSE/F/JaiVneb/K7qvRjQZOGQWo XZic8TdSPN7OFq1jGElEmZ9GJWeYbA/iXZPKxfw3rTFysYMOC5ivBxxRgyVNWDvX76s2 F6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=hMGcE1OY; dkim=fail header.i=@verizon.com header.s=corp header.b=lDUvC5Ro; dkim=fail header.i=@verizon.com header.s=corp header.b=KBbZ4TTN; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si426047pga.279.2017.12.12.18.25.17; Tue, 12 Dec 2017 18:25:17 -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=fail header.i=@verizon.com header.s=corp header.b=hMGcE1OY; dkim=fail header.i=@verizon.com header.s=corp header.b=lDUvC5Ro; dkim=fail header.i=@verizon.com header.s=corp header.b=KBbZ4TTN; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753621AbdLMCZP (ORCPT + 10 others); Tue, 12 Dec 2017 21:25:15 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:35576 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553AbdLMCAb (ORCPT ); Tue, 12 Dec 2017 21:00:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130431; x=1544666431; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nwmG9kVgruFlxYwCV0Xr+WtGCeSmsLlyn6IvT6yDQ3c=; b=hMGcE1OY6siizAcI41GASwEjtarY7feieuIdxUTGUhV4eqv30b+T/Ut7 PZXbyMBVjtI+38z5vA4i4BKRD+rkckj9xQTBop96iW5D51FrvfiDe1a3S BpIy3Pp+X9KQglNxKNhd3FVBJwXnWTF33vxW6ro9qDZBT7b1sNNac3WIE 4=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 13 Dec 2017 02:00:20 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2017 02:00:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130409; x=1544666409; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nwmG9kVgruFlxYwCV0Xr+WtGCeSmsLlyn6IvT6yDQ3c=; b=lDUvC5RocAwwVM80aFkzgGXbMvfagL1kmUPbeUPldGFPOVoLKy4LLm1g 0VCWyq/hNJx9u64FsvLpY7ObvFYqPUe1NqJful6jcV6YyXlW/Qm1UaurU rXC4d0fYy68OjiImFeO8CJfCvenmTi9e1ugF6xr1exmjJHa84LpdQ/aqn 4=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Dec 2017 21:00:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130410; x=1544666410; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=nwmG9kVgruFlxYwCV0Xr+WtGCeSmsLlyn6IvT6yDQ3c=; b=KBbZ4TTNRmRTsq7WnDU0Q+F1gZcfJ0E+v3Os+HXNuKGOgDghkFyr48p4 9uZKoruq1AlFZWJ8G6YAAhs4uBKUOSC60jbXujrNjdfA+oKy5q/SbOw4h QlIVR9QsARiKqt9/YNmKLz493z0Bqg/Yq/Wn+2nArvM/HyjM1jGeubYC+ U=; From: alexander.levin@verizon.com Cc: Arnd Bergmann , "David S . Miller" , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 13 Dec 2017 02:00:09 +0000 Received: from tbwexch29apd.uswin.ad.vzwcorp.com (153.114.162.53) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Dec 2017 21:00:09 -0500 Received: from OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) by tbwexch29apd.uswin.ad.vzwcorp.com (153.114.162.53) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 21:00:09 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 20:00:08 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Tue, 12 Dec 2017 20:00:08 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.4 35/59] isdn: kcapi: avoid uninitialized data Thread-Topic: [PATCH AUTOSEL for 4.4 35/59] isdn: kcapi: avoid uninitialized data Thread-Index: AQHTc7XirF4Q6ixRFkGe6/ZQaGmuag== Date: Wed, 13 Dec 2017 01:58:34 +0000 Message-ID: <20171213015817.6950-35-alexander.levin@verizon.com> References: <20171213015817.6950-1-alexander.levin@verizon.com> In-Reply-To: <20171213015817.6950-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit af109a2cf6a9a6271fa420ae2d64d72d86c92b7d ] gcc-7 points out that the AVMB1_ADDCARD ioctl results in an unintialized value ending up in the cardnr parameter: drivers/isdn/capi/kcapi.c: In function 'old_capi_manufacturer': drivers/isdn/capi/kcapi.c:1042:24: error: 'cdef.cardnr' may be used uninitialized in this function [-Werror=maybe-uninitialized] cparams.cardnr = cdef.cardnr; This has been broken since before the start of the git history, so either the value is not used for anything important, or the ioctl command doesn't get called in practice. Setting the cardnr to zero avoids the warning and makes sure we have consistent behavior. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/isdn/capi/kcapi.c | 1 + 1 file changed, 1 insertion(+) -- 2.11.0 diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index 823f6985b260..dd7e38ac29bd 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c @@ -1032,6 +1032,7 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data) sizeof(avmb1_carddef)))) return -EFAULT; cdef.cardtype = AVM_CARDTYPE_B1; + cdef.cardnr = 0; } else { if ((retval = copy_from_user(&cdef, data, sizeof(avmb1_extcarddef)))) From patchwork Wed Dec 13 01:58:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121710 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4903661qgn; Tue, 12 Dec 2017 18:23:43 -0800 (PST) X-Google-Smtp-Source: ACJfBovox1AuSGaflrYiFLYILh2TGvNM5YWdpt/963FMseMY957ycQkIZKySKJo+5jnQsKiOgd5X X-Received: by 10.84.241.67 with SMTP id u3mr4344445plm.275.1513131823014; Tue, 12 Dec 2017 18:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513131823; cv=none; d=google.com; s=arc-20160816; b=IquFcBiizBh3De32Bb2lxCipMRn76+xbNRPFoWD517+aJFurnRz4S+f68XsTNjSr+n 8FoQXqW8tV9vFLTCuFPq2KYx+YaABvVfSrJkNvspXPr+ubK+8u5VVqJ4TddSA8iyCT3y rKht+pVnMRknvKUq3Ps8XHpclHS63iBBLTqfjQp7W2xtSp7NbBV9lLxrWK10wu7vmGRm 0itsZq2rlWR9tfP37dy/sMtfBJ2JUecRAqGXBU16evXfmZm60wmF5RKRIpvt5NjeNiv8 wBA8zaB0p/Alp3YEuQg6zk2vChRIV1pet6gTRQ+xthmccvu64PEaOosibcmqr+R4j+ai zPTg== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=kCc5faJBXwdDwFtGuf9zkfseR0exJ5LLUuQNDQh6LNs=; b=DvG+JRzLY6rckPwCoU32WH9soSC0NeUEC1V4qIAhEQNI+RXIINrCduw2bkRSIcEtbv DzcYVDVkn86SgYF9Tq9jUDsRjUj8MI0G7Ye2xInBXgK7DoHbf/V89D5dSoMAwMkLPgVZ E4OpxHkKenuouDbDKEu2KfQp5skJoUuKX1cGkgTx4yzV518sqtU5kCpUVFA9mDqibbAb zxc08AaytfYHOrDLrY7HQGzwgXsT8lwnElDLRhy51T/mSEOvWIFaG1STJhT/WkoTvxrg X43OPLNnnZaU7X6YthwlQQjjl1/HIAlw0aogSZ3nmbq71vu7a7l0HojdB2L4hXpAWA/X vESw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=aabN0Q1W; dkim=fail header.i=@verizon.com header.s=corp header.b=RkF8PGS1; dkim=fail header.i=@verizon.com header.s=corp header.b=udZoxdPT; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si448841plk.773.2017.12.12.18.23.42; Tue, 12 Dec 2017 18:23:42 -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=fail header.i=@verizon.com header.s=corp header.b=aabN0Q1W; dkim=fail header.i=@verizon.com header.s=corp header.b=RkF8PGS1; dkim=fail header.i=@verizon.com header.s=corp header.b=udZoxdPT; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbdLMCXg (ORCPT + 10 others); Tue, 12 Dec 2017 21:23:36 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:35576 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753569AbdLMCAd (ORCPT ); Tue, 12 Dec 2017 21:00:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130433; x=1544666433; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KIwtbrmSVaW7pLGvcLoHdTjTDpqXZdDLOL3InW1lDO8=; b=aabN0Q1WhF5UqCjPbWfKfzQu0T8H4aNvj88M8CQLyd61gfVL0J3Vu3Ou tT3EfwrM90el57XNrrKJyvGmxFT1weB+TVOiVdj0vTWPEEqTAzbIfHKbd K/Xpr3fLsgDMtKPii/YFu06fm+3IEU6/LvKnSG8ZBEiQSxWgcEvdpIEtf A=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 13 Dec 2017 02:00:21 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2017 02:00:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130415; x=1544666415; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KIwtbrmSVaW7pLGvcLoHdTjTDpqXZdDLOL3InW1lDO8=; b=RkF8PGS1vh9RZSL/t+U/kxTiJluPbMIDNGFMTnQPuF6BMuEJwQO+LsRN JlI3RnL9vtZ+SnmkmUL9AoMrOMHx621NL4fmgBtRsw9FmejunNAXe9k7J EEbBxkhSohUDxhYT9tJX+xF5pOgnqtDmPxq7U0Dkyh3w9s+QucCPEI4MQ c=; Received: from endeavour.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.163]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Dec 2017 21:00:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130415; x=1544666415; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=KIwtbrmSVaW7pLGvcLoHdTjTDpqXZdDLOL3InW1lDO8=; b=udZoxdPTPwpUKqgCbmqDBy1sOnbB3Uc+qjWLIeZ+fTetafpamB3FWWH4 JxZW3t/BmBNIEhesrB2evcaaHI+oPC6lF21/dblkQcToycCErH4DkAXmC vRcBLQ5yNzsCd5aL8IbiJqlpm1I8KE5MB/ySHhG3sySr4wkVD7kqChXCw U=; From: alexander.levin@verizon.com Cc: Dan Murphy , "David S . Miller" , alexander.levin@verizon.com X-Host: endeavour.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 13 Dec 2017 02:00:15 +0000 Received: from tbwexch17apd.uswin.ad.vzwcorp.com (153.114.162.41) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Dec 2017 21:00:15 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by tbwexch17apd.uswin.ad.vzwcorp.com (153.114.162.41) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 21:00:14 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 20:00:14 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Tue, 12 Dec 2017 20:00:14 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.4 44/59] net: phy: at803x: Change error to EINVAL for invalid MAC Thread-Topic: [PATCH AUTOSEL for 4.4 44/59] net: phy: at803x: Change error to EINVAL for invalid MAC Thread-Index: AQHTc7XjY4IE+c5A8k6FSy971Kga/Q== Date: Wed, 13 Dec 2017 01:58:37 +0000 Message-ID: <20171213015817.6950-44-alexander.levin@verizon.com> References: <20171213015817.6950-1-alexander.levin@verizon.com> In-Reply-To: <20171213015817.6950-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Murphy [ Upstream commit fc7556877d1748ac00958822a0a3bba1d4bd9e0d ] Change the return error code to EINVAL if the MAC address is not valid in the set_wol function. Signed-off-by: Dan Murphy Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/at803x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 2d020a3ec0b5..37333d38b576 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -105,7 +105,7 @@ static int at803x_set_wol(struct phy_device *phydev, mac = (const u8 *) ndev->dev_addr; if (!is_valid_ether_addr(mac)) - return -EFAULT; + return -EINVAL; for (i = 0; i < 3; i++) { phy_write(phydev, AT803X_MMD_ACCESS_CONTROL, From patchwork Wed Dec 13 01:58:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121702 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4886110qgn; Tue, 12 Dec 2017 18:02:04 -0800 (PST) X-Google-Smtp-Source: ACJfBoseRP+0Lj25nxH2J61GQE6dijnveIXLkqTjnh7R1rbBtgt3YnB2LjAeZih8WfrXLYKF0wqk X-Received: by 10.99.119.15 with SMTP id s15mr3803188pgc.90.1513130524106; Tue, 12 Dec 2017 18:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513130524; cv=none; d=google.com; s=arc-20160816; b=BgYw+uFtoEyMO02OpYao87nSAKp5ClLfHdzCc1MTdOtzAkTHKMPuHA9udpdowleDMJ vdi9ZVXYhiCVkrDbOjMSkVcUBNUJTeWpxlmc6Rv6vvnxd6cSp9mJiyXmkAf9aQ3aYMbp C90ci8R7sqBPNmsmr0VFW8aWrI258LDO6CoWcZA/+7y7xobXvLujkbJv2FgTx76JOKuN piJaAovkHdAXa4w7Hx5jUtUW/o7nLMLvQlqy66EDRMduZ+OVUSMwPf+DyckKNZ1lIRVo LGg4mqEvoCy28FZ94jj3yV7kDsPyrpDSxOkZav+4+IBnzRh/oyCMyplIooIyl46yodEe H0lw== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=peDbPfbp/7zGokig6k8FF1bWTIcV/Z7UCLWI9w8DHmA=; b=uxhsUbqIWHp5FzqvzXRJLTEdAHBsEUsUvbcSMPUvNL/lmIDlXa3bMpQhpogoH03GYk NjPUQL9atriLbM4woygO0cwSGgvAUkU7Q30Yd5tBczVJylG/b8zimaDlZLJTfyVLOKOb TiAFDwSHhKOJPOCe/AoqRrou1jCj0SrNZFFSFjrkqMiTapFUTOXSEEsiKBJrP0bjsfcC BoueVozCcRLkpx2IwhY1zno3l+szXhHLFOhI7eAMSEJjqGehLKBDUlZifMOX/ULTPVRT YP6+LmuUspCfpvgfdwIzlB6G/zvnJcbMR0xB09fKYYFd6nKCivCuesHWW97NF17JaDCv VlBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=Qq6SNqCM; dkim=fail header.i=@verizon.com header.s=corp header.b=TDGOoteS; dkim=fail header.i=@verizon.com header.s=corp header.b=q22u9qFt; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h188si390358pgc.559.2017.12.12.18.02.03; Tue, 12 Dec 2017 18:02:04 -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=fail header.i=@verizon.com header.s=corp header.b=Qq6SNqCM; dkim=fail header.i=@verizon.com header.s=corp header.b=TDGOoteS; dkim=fail header.i=@verizon.com header.s=corp header.b=q22u9qFt; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753847AbdLMCB5 (ORCPT + 10 others); Tue, 12 Dec 2017 21:01:57 -0500 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:49281 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbdLMCBy (ORCPT ); Tue, 12 Dec 2017 21:01:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130514; x=1544666514; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=CvirPqh17RAsxnosN75CjNcwkZSFe3vfghUAmK1/E6I=; b=Qq6SNqCMp7J0ARbq0H1ZgqTQ+QQ2E5OM68Z3drbvb39dcqdxX/+2neFX 3+0e/TvbpIAjVfh8ECXOXTA0uFoasdZyIyBerV2emcunEJash3XZP0AOy JpRSYn3UsxirANvOQWm5gZF4St/eemtUpc6C3EAJwhDN5+PAcMqQEeins c=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe03.verizonbusiness.com with ESMTP; 13 Dec 2017 02:01:53 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2017 02:00:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130483; x=1544666483; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=CvirPqh17RAsxnosN75CjNcwkZSFe3vfghUAmK1/E6I=; b=TDGOoteS9wDTgwfx74buEKzf2NozTRfSjy45SuQ65PQIx9zZOM6K4BMD zfNw4GE2FW/nKJzkjGS0cS01wKgEVgQOpzW34jo1O9TCC7V3ifmEKDFEp cU0zbn65UJVI/e01Oc+euQNgCK0XG+JFaB+PHaejGt4ZXYcvELoaCp7pV 4=; Received: from mariner.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.84]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Dec 2017 21:00:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130450; x=1544666450; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=CvirPqh17RAsxnosN75CjNcwkZSFe3vfghUAmK1/E6I=; b=q22u9qFtTPms2zFSId58Augw1IAiccjgNi7eOFVedRCyvyHMYwL/unP6 +7KYMPuIshUyYfB0LJtIWhNhPi3z1gRzILT0MIIAN6pIz75Lc4a5Mbxbl j1CedCfXCNJHv1QcyShqVn/PX7BViJrAvMXiCmgGhcKutpcN82Do0kJHs 8=; From: alexander.levin@verizon.com Cc: Gabriele Paoloni , Dongdong Liu , Bjorn Helgaas , alexander.levin@verizon.com X-Host: mariner.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 13 Dec 2017 02:00:49 +0000 Received: from tbwexch21apd.uswin.ad.vzwcorp.com (153.114.162.45) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Dec 2017 21:00:49 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by tbwexch21apd.uswin.ad.vzwcorp.com (153.114.162.45) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 21:00:49 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 20:00:48 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Tue, 12 Dec 2017 20:00:48 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.4 51/59] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Topic: [PATCH AUTOSEL for 4.4 51/59] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Index: AQHTc7XkTFVfq9tqzkiw4CBxYBXwFg== Date: Wed, 13 Dec 2017 01:58:38 +0000 Message-ID: <20171213015817.6950-51-alexander.levin@verizon.com> References: <20171213015817.6950-1-alexander.levin@verizon.com> In-Reply-To: <20171213015817.6950-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gabriele Paoloni [ Upstream commit 86acc790717fb60fb51ea3095084e331d8711c74 ] Previously, if an non-fatal error was reported by an endpoint, we called report_error_detected() for the endpoint, every sibling on the bus, and their descendents. If any of them did not implement the .error_detected() method, do_recovery() failed, leaving all these devices unrecovered. For example, the system described in the bugzilla below has two devices: 0000:74:02.0 [19e5:a230] SAS controller, driver has .error_detected() 0000:74:03.0 [19e5:a235] SATA controller, driver lacks .error_detected() When a device such as 74:02.0 reported a non-fatal error, do_recovery() failed because 74:03.0 lacked an .error_detected() method. But per PCIe r3.1, sec 6.2.2.2.2, such an error does not compromise the Link and does not affect 74:03.0: Non-fatal errors are uncorrectable errors which cause a particular transaction to be unreliable but the Link is otherwise fully functional. Isolating Non-fatal from Fatal errors provides Requester/Receiver logic in a device or system management software the opportunity to recover from the error without resetting the components on the Link and disturbing other transactions in progress. Devices not associated with the transaction in error are not impacted by the error. Report non-fatal errors only to the endpoint that reported them. We really want to check for AER_NONFATAL here, but the current code structure doesn't allow that. Looking for pci_channel_io_normal is the best we can do now. Link: https://bugzilla.kernel.org/show_bug.cgi?id=197055 Fixes: 6c2b374d7485 ("PCI-Express AER implemetation: AER core and aerdriver") Signed-off-by: Gabriele Paoloni Signed-off-by: Dongdong Liu [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/pcie/aer/aerdrv_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 4e14de0f0f98..ca5dbf03e388 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c @@ -388,7 +388,14 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, * If the error is reported by an end point, we think this * error is related to the upstream link of the end point. */ - pci_walk_bus(dev->bus, cb, &result_data); + if (state == pci_channel_io_normal) + /* + * the error is non fatal so the bus is ok, just invoke + * the callback for the function that logged the error. + */ + cb(dev, &result_data); + else + pci_walk_bus(dev->bus, cb, &result_data); } return result_data.result;