From patchwork Thu Mar 8 04:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130944 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6071804lja; Wed, 7 Mar 2018 21:55:34 -0800 (PST) X-Google-Smtp-Source: AG47ELuU/6E7HtDJH58B4QaJlJXtshK5wLwWesAz6K2QddEIYDaXLyAXXfFOXS7FM3nMJGhZ4bIt X-Received: by 10.98.194.219 with SMTP id w88mr25266704pfk.26.1520488534701; Wed, 07 Mar 2018 21:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520488534; cv=none; d=google.com; s=arc-20160816; b=KPnW4XRnD/zewl98vCBb09K71ofr/UhsdCRpVQlA+BR2LrWKsNOlJxNOsZxSXDitUh srIP3NwI1Ew1NwMWwrUDc7NrmGZjhYCd03EjWJHjAPG4aAsxyWhKn1L/vubmmlOMS5Qc MxU56Ov4t4yXmYP1olENgAg4TW5ph/Cl3bgcnD0Tr75i3U/FtDlEJivSjrYzMg+I/O8I hu/nJ3RstYT9x0ziN6XeRsyaz/V2PwqVmRESRrhh+yQjtFcJvN7tAj2gG0F9BQk9UEgC 1y/yFxhh3zgiccearQqgc09prhlr1f+wEEEZNhPO6In4MgBrb/Eo5lDuG+3oZ6opGxtg oRSw== 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 :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=dKF+F1z+Ns72/GrMw9rlhOLXVXBjWN9dwGOZr+koKqI=; b=dtI2lTmJ0IJgt2UMpo1TYys2V9Ho+VX4ntnF5jDHn1i9f4KsG92zcLezGhzKammRLG E1jEdv+p7irjV2R3VPrFcjjAjiIPmPFFmA7IuXCroKMuolZGieGUy1+zDZ9SqfxdP0Pu Cqi7d5PqF0wUN191DZHCV8uEybGEINKdsWPsTiLbJMqrjpvZEuAPdeLB6OBOZ9BHHvVi WI66nhAyFdaDQ0HEAImh4a6qLouwwVusmydJPCJpuz0CvG4n/LZ0LIUDJkFmTvSs/IJN r2boF+Qjbx6NSH1Qa2rCNyKwu2/Ekr8UHHvwDLpD8n318zcSh2aFhhLrkydwZibqgP/Q IDMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=fG2fyDH5; 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 w66si15164136pfi.23.2018.03.07.21.55.34; Wed, 07 Mar 2018 21:55:34 -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=fG2fyDH5; 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 S965655AbeCHFzc (ORCPT + 10 others); Thu, 8 Mar 2018 00:55:32 -0500 Received: from mail-co1nam03on0092.outbound.protection.outlook.com ([104.47.40.92]:45512 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755336AbeCHFD5 (ORCPT ); Thu, 8 Mar 2018 00:03:57 -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=dKF+F1z+Ns72/GrMw9rlhOLXVXBjWN9dwGOZr+koKqI=; b=fG2fyDH5oN19wOPKpXiYAD8sMxNseWA3P/5BR51pHgF8+HMko5sGZaz2tX/F4gbAI8nO+TD/YCTf3iWl1fHX5JTTp9H70EA/Kzt9TTQejm3Hw3ldT4Pk1pKEZPh4abAB43pvRDEKU2FTIX0NnCrljq+ChnbVAG2uP5HwSWvMcBU= 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.588.3; Thu, 8 Mar 2018 05:03:54 +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.0588.008; Thu, 8 Mar 2018 05:03:54 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Loic Poulain , Marcel Holtmann , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 152/190] Bluetooth: hci_qca: Avoid setup failure on missing rampatch Thread-Topic: [PATCH AUTOSEL for 4.9 152/190] Bluetooth: hci_qca: Avoid setup failure on missing rampatch Thread-Index: AQHTtppPwAPiQSIrL0uKK9ekny2Glw== Date: Thu, 8 Mar 2018 04:59:59 +0000 Message-ID: <20180308045810.8041-152-alexander.levin@microsoft.com> References: <20180308045810.8041-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045810.8041-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:r7cWPKu6f4Xt9WqbwIHWEUoj1X3CtiTuwWxKoL9SNlbtHZCkJWBBP8tlR04pa5CsNGLawPUNsNigcwGl1uKe9qF0Z8F5wbLw9BcFZ3s2UoKqWe80y+WHf3wEbw55C3xD4Vl0HC540pSw9xEtcNNab8sxX1cIroDhQIlJmEEUF/hZMDKtMMOTYXzUDYGS/HV8alfuhzI2IcKz40KWHQK2I6WszdFMQ6EPXsSteS/FYNwQabzf4qm3yiBPsoFyc+Ne; 20:zMgvyND/pyX37Qb1RbO3pZBw+Q723Jjh/aPRy7+g22UDoaNKbo8VK8ejq1jHSA1eZf9F6+3VcR17ZBUPRUUu8C0Xu4mOZl9fi1bG3SdvEUexnnvlPJbGjUryic4GCIq1T27d/UFjMZ1vmR/EdtgH4PnFvARQT8z41SnaQvJrtwM= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 335ed3aa-2ffd-48e5-f7c4-08d584b1fda5 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231220)(944501244)(52105095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB0902; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0902; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(39380400002)(376002)(366004)(396003)(189003)(199004)(8936002)(81156014)(81166006)(7736002)(5250100002)(8676002)(99286004)(26005)(107886003)(186003)(2950100002)(106356001)(10090500001)(305945005)(66066001)(97736004)(2501003)(86362001)(3846002)(3660700001)(72206003)(6436002)(1076002)(6486002)(5660300001)(54906003)(110136005)(68736007)(53936002)(14454004)(36756003)(25786009)(478600001)(10290500003)(6506007)(2900100001)(102836004)(76176011)(6512007)(22452003)(6116002)(316002)(4326008)(105586002)(86612001)(2906002)(3280700002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0902; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: BlOaXy9AYk8NRpviluHk4GEcgmSxxq8kveJEhNALpu9WdhmybAXOWGg1m7PcEz087IYIm2ovoOkYQzzCP3Vhm5T0vi/J0vKqy+mRAxPgrRS/cJ7wyEMZ2YkbqntigZFd9mD+F9gV6wNj2efbfsjSbMq6DMhLyxjF9bwbOOwjagUhzH+JPZVPHWPt4JM9PH5h++pMZ3Qaj9xgx09zQSWysIhKjoCpDmLVyyQ8N1fM7hhwXkDzeQb2SM4NoGNHC/uFWyYGtQMt/hhRYUErMEhbMPd+TNZKrRwZQEMZwPOU6pfDqvI7JyxfiMx7zX8n4N/Rc8TtwfdRpG+E0vnTuvT4xw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 335ed3aa-2ffd-48e5-f7c4-08d584b1fda5 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:59:59.4720 (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: Loic Poulain [ Upstream commit ba8f3597900291a93604643017fff66a14546015 ] Assuming that the original code idea was to enable in-band sleeping only if the setup_rome method returns succes and run in 'standard' mode otherwise, we should not return setup_rome return value which makes qca_setup fail if no rampatch/nvm file found. This fixes BT issue on the dragonboard-820C p4 which includes the following QCA controller: hci0: Product:0x00000008 hci0: Patch :0x00000111 hci0: ROM :0x00000302 hci0: SOC :0x00000044 Since there is no rampatch for this controller revision, just make it work as is. Signed-off-by: Loic Poulain Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_qca.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.14.1 diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 6c867fbc56a7..74b2f4a14643 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -936,6 +936,9 @@ static int qca_setup(struct hci_uart *hu) if (!ret) { set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); qca_debugfs_init(hdev); + } else if (ret == -ENOENT) { + /* No patch/nvm-config found, run with original fw/config */ + ret = 0; } /* Setup bdaddr */ From patchwork Thu Mar 8 04:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130934 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6033480lja; Wed, 7 Mar 2018 21:04:05 -0800 (PST) X-Google-Smtp-Source: AG47ELs9Ii+R5SSMYcpFza76C+4YED5ZpZ4iODtdWX2wEA22YEoNPdt1SYRzF15hmZ9cHDRcjyQI X-Received: by 2002:a17:902:a60d:: with SMTP id u13-v6mr22558167plq.165.1520485445639; Wed, 07 Mar 2018 21:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520485445; cv=none; d=google.com; s=arc-20160816; b=OQAZPw4uzKkYryqq8jMfIq05/GOMzGu4aN/pQIWzMq0g8XwLy0Qxjx0gHheKSzOrqI a15Ip/vG+IBrhTsKT15JPnmh0m7o909XzdQm5Iw8reJfwpO075e7Q6hN9WkmYi+yoQWB oWmaurv+I3X+dbDVSYuZMq0bXSanCBCmsdQy1IwLcAvFfieY3DIRtX26xiNjIA+gIfaU qRUdkaCVng14rjhZhUEo9l8x6zyLLHFy8oxC2nmBiS+qCTrIlP6xpFm/vdSuguGzAVXf CuaX5s7gLKa2i7QoNS13oMCXIsEmnrw0XDjNYPAzp+Ye3mMjbIuxPLwRZyrzMGjOJTjm Y6uQ== 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 :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=uyaf5HsN8Cd6P2drtdaUXJ/w8lDox6ZQWhmN3kmv+aM=; b=wr3xkY22XQe/mRMkztbmEW9VY8WkFqcC5G7BsIQYBx0SKvNbFqb/wGY56xTSjj0nGi ipE4QID0DO0+ijtkzworAimZwTDEOU5J315uCefsTqAQJyXpJPqB/g/fuuk4LMLM1IIw HOj4Y1Iblqbx68brxL/fnTOpNODvIhVlNgXO40w8WrpuGOtjbDZHQ9WIFc2Wynemg7TO J//MCDEwSjmrBnwT+EWQ61ZNXRtGX6hNYpgTZNY29S00PFbFwko/xnE2lUkiAeIRL5dY 9/ugQt03Pc7s/jwnK2tia59wHdfyIkopt5uGvBIAPd0sX4ACXjiBZzPpRyoD7Sva7DFh S6tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=laQqHp2m; 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 j14si1936401pfn.150.2018.03.07.21.04.05; Wed, 07 Mar 2018 21:04:05 -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=laQqHp2m; 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 S966096AbeCHFED (ORCPT + 10 others); Thu, 8 Mar 2018 00:04:03 -0500 Received: from mail-co1nam03on0092.outbound.protection.outlook.com ([104.47.40.92]:45512 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966085AbeCHFEA (ORCPT ); Thu, 8 Mar 2018 00:04:00 -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=uyaf5HsN8Cd6P2drtdaUXJ/w8lDox6ZQWhmN3kmv+aM=; b=laQqHp2mVQ+O55aomf+kGTlWdiGdSQpPdXWbXTpe5HcH8na2EYXXMhGfapdgFi6IxqAZSIzqzTB4K7IS4ia3NRrVFZebczFi6vqwnu8iy3tq0HP9r72ux96j6Qif82EujA4TNaRofV0209uWWg2Qzvn1312kJlSD8EWvBCNKBJo= 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.588.3; Thu, 8 Mar 2018 05:03:54 +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.0588.008; Thu, 8 Mar 2018 05:03:54 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Loic Poulain , Marcel Holtmann , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 153/190] Bluetooth: btqcomsmd: Fix skb double free corruption Thread-Topic: [PATCH AUTOSEL for 4.9 153/190] Bluetooth: btqcomsmd: Fix skb double free corruption Thread-Index: AQHTtppPf4KU4wF3PUCx2PlgKImAqA== Date: Thu, 8 Mar 2018 04:59:59 +0000 Message-ID: <20180308045810.8041-153-alexander.levin@microsoft.com> References: <20180308045810.8041-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045810.8041-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; 20:blq5u8zkCLigCyLgG28lsvZQGDG5IgCwBawLbAosm2eEmdp3gU4JwhSCeFTpinhftc4CgI0KNl+iQ9VA53n8YmvqBdHFVHx4d1zaTM6WLDqO9RjkAr9fze8FgRSy1mbTL9TSnUx5ZqGk34gaY8Ntie3tFK8DQACvI5O8eaAzdfo= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 99bff63e-2584-4623-4d7c-08d584b1fdf4 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231220)(944501244)(52105095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB0902; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0902; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(39380400002)(376002)(366004)(396003)(189003)(199004)(8936002)(81156014)(81166006)(7736002)(5250100002)(8676002)(99286004)(26005)(107886003)(186003)(2950100002)(106356001)(10090500001)(575784001)(305945005)(66066001)(97736004)(2501003)(86362001)(3846002)(3660700001)(72206003)(6436002)(1076002)(6486002)(5660300001)(54906003)(110136005)(68736007)(53936002)(14454004)(36756003)(25786009)(478600001)(10290500003)(6506007)(59450400001)(2900100001)(102836004)(76176011)(6512007)(22452003)(6116002)(316002)(4326008)(105586002)(86612001)(2906002)(3280700002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0902; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Ktt4a4pd4T8l9B1CGJk3k4Cz29XTLyFeX4rE8JiufC5n/ErEYNRKDjFRSi+YD7Adr+pKANZyi/bbPYDPoz2cfA7VgldDxMpJUhnmXgCIbHFp2VUNxP5P+CzQZZov9aQ//ts1kB38jJOS2hqMYN2InwkSN2Mfz2B0V7wBpAyNfvh4dP2Ln1xs5DW+0XBRnyEF8J5A7hA+Z6nFbqohd0aLEU7TCosRqlhCXbnhbzv3toUzWvIL/gCfAiqB3gaANi1PB8reUdvQyW41AujyLJ38xxWbi940RO8i3thRxJg3zlE66OY3kkZyrKapL0bFTlUqWRqp0vvUkHZMgCy1NFKpcQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99bff63e-2584-4623-4d7c-08d584b1fdf4 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:59:59.8803 (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: Loic Poulain [ Upstream commit 67b8fbead4685b36d290a0ef91c6ddffc4920ec9 ] In case of hci send frame failure, skb is still owned by the caller (hci_core) and then should not be freed. This fixes crash on dragonboard-410c when sending SCO packet. skb is freed by both btqcomsmd and hci_core. Fixes: 1511cc750c3d ("Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver") Signed-off-by: Loic Poulain Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btqcomsmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index 08c2c93887c1..3aac78a5091b 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -85,7 +85,8 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb) break; } - kfree_skb(skb); + if (!ret) + kfree_skb(skb); return ret; } From patchwork Thu Mar 8 05:00:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130943 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6070813lja; Wed, 7 Mar 2018 21:54:09 -0800 (PST) X-Google-Smtp-Source: AG47ELsSH75lzXjDFa4WqJMAcfaU7qlwMgYStb+120WKZ779ne2g45tVKnro8VuMUmltX9U3PREa X-Received: by 10.101.78.5 with SMTP id r5mr20207355pgt.33.1520488448878; Wed, 07 Mar 2018 21:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520488448; cv=none; d=google.com; s=arc-20160816; b=JGeQgDLvVbCs/mXID0uzRcD1Gor0a93ZXUci4i69hMsQBOp9GlTjWBrGpyDf2zyB7O +NaEdySf9afp9/WlNYR/w8QIIEOEk5qsKDklCz207k6cAgQyl7NAQtRQ4RqQFCoz9FoQ ObGsgoHdGBCWeLuS+8t0GpCcYEb4CV5GLcpBfhHguQ+sV1GUctrJDxn1P6ze5LeJ4s76 QdVwTakW4BqtfwerxfsMD0impH/Stc2qQRCs539VOKdoY34tWid6UGTJezsx3gBCO2oZ m5snq6N8SZvpT6yglSeXAWzTXea1xeu9BM/wNfb8YC8QFIro9xHoLaK9lzFYQ3NKw0vG tOWw== 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 :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=AkJhVfJ1nAur6Od7PlwDuH0UJiq+I5seQQeV+TnQWkY=; b=iuea/MD2TG0ksA2/DpIbOSKFpqj7NLZoP7YVSy6ogYHppNUjNXzYVdFq1giZJqd2a7 Xju50UeHkel0HXHL1O7RiapnXPVxAmPjdE5KoxBlrtRhDtoBYby5hw/n5wZszbqkuen1 fQ6+xljfUckah/djH98SGeYDthFS+D/ZoZi45ChfQy+qdGNgAsCqz0nogiLsF/hm2MSE g8jNiUSja5uQjXTe5Kv8tVP56Rp7s0VlneTjVbLl0gNaRv2oqGK23Y8Xk4SwNVP9z3a/ 4VhcxX51s7Vinr55BA6NobY/WVCUAy+04tuTwKErInsEA48varBzge/6MG4cwyLfnDEW QKAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=T2evC7ug; 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 m13si2828040pgc.35.2018.03.07.21.54.08; Wed, 07 Mar 2018 21:54:08 -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=T2evC7ug; 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 S966097AbeCHFyH (ORCPT + 10 others); Thu, 8 Mar 2018 00:54:07 -0500 Received: from mail-sn1nam01on0105.outbound.protection.outlook.com ([104.47.32.105]:60007 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966094AbeCHFED (ORCPT ); Thu, 8 Mar 2018 00:04:03 -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=AkJhVfJ1nAur6Od7PlwDuH0UJiq+I5seQQeV+TnQWkY=; b=T2evC7ug8zfbendAG+rVuYSxivMIrfN4E2R5bmdpMs8US0cGaiLEIGxBPPGK6ubMpxjGPRkkHqY+kpTthPmyOLmChu5y/xCPtF82diBhkWBJcuUAhiL3FODabeBKKbWaNVBiNHggNo0ukZ3vxR0EdeEho4+Xp4XXmpTMazX193E= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0872.namprd21.prod.outlook.com (10.167.111.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.1; Thu, 8 Mar 2018 05:03:59 +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.0588.008; Thu, 8 Mar 2018 05:03:59 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Arnd Bergmann , Benson Leung , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 164/190] cros_ec: fix nul-termination for firmware build info Thread-Topic: [PATCH AUTOSEL for 4.9 164/190] cros_ec: fix nul-termination for firmware build info Thread-Index: AQHTtppSXkaj6D3WyUCUw3iFlEReag== Date: Thu, 8 Mar 2018 05:00:05 +0000 Message-ID: <20180308045810.8041-164-alexander.levin@microsoft.com> References: <20180308045810.8041-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045810.8041-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; DM5PR2101MB0872; 20:Z2+t14GFOcOi4PLMOYWT32ipyobpCEorJ7QYt4g2AfJ6afmZp2l7uiTWIAFcsbBloJf1rARegRzGp1MwEaF54ljZ3vVKdLvnZH7khCko3D7RruPkCmUA+bOKvDNQz7z/gcDnr2H8o83+urBl54Vz6cWB0a5ek8lWT99T1pMOYok= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: eba4705e-27d1-4f95-ee96-08d584b200fc x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0872; x-ms-traffictypediagnostic: DM5PR2101MB0872: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(20558992708506)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR2101MB0872; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0872; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(346002)(39860400002)(39380400002)(189003)(199004)(5660300001)(186003)(5250100002)(26005)(316002)(1076002)(4326008)(2501003)(2906002)(25786009)(76176011)(99286004)(6436002)(6486002)(6116002)(36756003)(3846002)(575784001)(22452003)(3280700002)(6666003)(2950100002)(86362001)(97736004)(8676002)(10090500001)(305945005)(2900100001)(66066001)(102836004)(68736007)(3660700001)(14454004)(7736002)(53936002)(6512007)(86612001)(110136005)(54906003)(6506007)(106356001)(59450400001)(478600001)(107886003)(105586002)(81156014)(81166006)(72206003)(8936002)(10290500003)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0872; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: W50d4dnY1t/4jaUpEqzqjif5ngoR8xnarczcKbRsx/vfCZ5tnc4XlaIaoRMzP+ew2vhE6rbH8/sH44jDVRRuFcAWfgE96eGNj8alm5NWf/ATx5AiGck4VvdO8/RH4u9GC4lLwK4xYSquFgjzwk5kEOGzgeYnSRBZl5yGexqJ4KRiAagi+GsDrEBFk/zst3mFn/lsolHBXVw3dxeesxBjxfr6wZtcCUMbupzrHsVPJkIdMPwZhc7kuQEJbjDZpCHHB/5y6RYg2qkrwgHPm+eddVbYON1WdQU/6KD25tyjD/hsZ6CEiIL/tOWMl0YIjk3eMapwp+ZIQLMap7Q23FOeEQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: eba4705e-27d1-4f95-ee96-08d584b200fc X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 05:00:05.2080 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0872 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 50a0d71a5d20e1d3eff1d974fdc8559ad6d74892 ] As gcc-8 reports, we zero out the wrong byte: drivers/platform/chrome/cros_ec_sysfs.c: In function 'show_ec_version': drivers/platform/chrome/cros_ec_sysfs.c:190:12: error: array subscript 4294967295 is above array bounds of 'uint8_t[]' [-Werror=array-bounds] This changes the code back to what it did before changing to a zero-length array structure. Fixes: a841178445bb ("mfd: cros_ec: Use a zero-length array for command data") Signed-off-by: Arnd Bergmann Signed-off-by: Benson Leung Signed-off-by: Sasha Levin --- drivers/platform/chrome/cros_ec_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.1 diff --git a/drivers/platform/chrome/cros_ec_sysfs.c b/drivers/platform/chrome/cros_ec_sysfs.c index f3baf9973989..24f1630a8b3f 100644 --- a/drivers/platform/chrome/cros_ec_sysfs.c +++ b/drivers/platform/chrome/cros_ec_sysfs.c @@ -187,7 +187,7 @@ static ssize_t show_ec_version(struct device *dev, count += scnprintf(buf + count, PAGE_SIZE - count, "Build info: EC error %d\n", msg->result); else { - msg->data[sizeof(msg->data) - 1] = '\0'; + msg->data[EC_HOST_PARAM_SIZE - 1] = '\0'; count += scnprintf(buf + count, PAGE_SIZE - count, "Build info: %s\n", msg->data); }