Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp858994ybh; Tue, 10 Mar 2020 09:33:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsBWd2ijD3il+63FvC3jYHSG8546lsT/5K5Ap7yjA+BzNzMb3bP6NXGqS3/fUPFJCruYGZH X-Received: by 2002:a05:6830:118c:: with SMTP id u12mr16658825otq.124.1583858013862; Tue, 10 Mar 2020 09:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583858013; cv=none; d=google.com; s=arc-20160816; b=PgeIrokHI4tka6aaFdiblk2qtXn/c8U2PfXBP+F2EYZqKDB6n/efvcZPt6PXIVSjhb 2QouHR8s+0RII9AynTCR7HwBF5TV0CtrFaGkJFuJ28xA4VeC9on8TTpVj1HvJlGNvVO8 jXato+ANOneJ2smziaPJPuusHl1MoJsEPphZV59DH+30Au56aUpwkBrfxYW11qsuVbai eU/5kzTviyruu4IBo93evsCOiPZp8T8HgziffIS+utpCCGXVdauo7hgLizOx+zKbpBds 96DL3YsVVtqA/J5iEJGNUfyCxq6OvK0x9TbwXCmkHLRmmS3i3N/PKl+MD9bzwiuDXGG1 effQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=orSnkR0b0kEaczXYpxz6sH2e+X0g5twrn8pQx+WIZsU=; b=VoQmeSxwFRvzVWoSMW/0GgpgmL4mE6+DRuUYK4BPVLLKC/UCV7JEe29t65eIMa2Lut TbsoSs/baj3iMbluDjFwva4lpG9WEepVOjrEZFkWe/fTqUdfqLoIS7RHv3iYohm+4LO4 Xd6UKuZ2uCKcL5g9vGMXO/1tfH5Afd7F50SxdPOr+HMdL7kGYjzG9kJ3f5nbI3Zp4u4m Y6TQK8EKQE74wPn3fiTTN7xrDSq3dPSksUbtkfG4USgK7cF6aV0R/4Hw/qqbHcRfaukf VCRmNbFnGRjHcyVVhMvL4AeE7wjRAwYn04646ucwy4SHKqMbaOdwkCKTzkIpfHSTbb3Z UdOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f9d7nMDE; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13si644250otd.167.2020.03.10.09.33.00; Tue, 10 Mar 2020 09:33:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-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=@google.com header.s=20161025 header.b=f9d7nMDE; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727447AbgCJQcp (ORCPT + 99 others); Tue, 10 Mar 2020 12:32:45 -0400 Received: from mail-pf1-f201.google.com ([209.85.210.201]:38086 "EHLO mail-pf1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727411AbgCJQcp (ORCPT ); Tue, 10 Mar 2020 12:32:45 -0400 Received: by mail-pf1-f201.google.com with SMTP id f14so4980001pfk.5 for ; Tue, 10 Mar 2020 09:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=orSnkR0b0kEaczXYpxz6sH2e+X0g5twrn8pQx+WIZsU=; b=f9d7nMDELRVltXLuc+w/x0sA9qcoRpITVlGtCZMS3SIPIR4GcWsOQof7Ev82kZrUii yH3Z0EpkdC9MD2e2RMoP4DIxM/2rLW21qeBviJy2WyMN1ZrMJs0Bhjx49QLTzoJNBTgU 4DMR+vHmZuhQ5UxOTBoN5opUtIVAkohIuqimV4s5pO8ct8XofVo/Jq4E51k5/JCWKCg/ 9Xdi9jFPKgNrJJHhPKJRGbDvxBibwI2RwjxjoxPElmsRuV+ytDt3a1OncyBBUIt6mv7u nnMwGE+x2qN37Zue0ZsnAEUNJ6aiIz2zNk6x/lDi8UuFo+udFUd6vGTP/HhRoUoJ4q9R XdxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=orSnkR0b0kEaczXYpxz6sH2e+X0g5twrn8pQx+WIZsU=; b=itD9xwKE9w0DpkeH8A8dTizL0qQLAWQj3PxpJ/Mdj4zyyU5gW8khwyRn1ZTZ5aBeXO vKQtE+hFEqJaC7zVNL7Pk2nerw/X8V4/+/LR6wV32MxDcEVqAGEXmHpaHEGa6PnXXNDq Mnu8kFJuNMeopv1DrE/5dfB8TEHC4wZ0Biz1wzkZ6xkyMm6ghy0+/LCIrJbqfgeJ6vH7 3hGIEbhxtqxeej4Hw3jhN61tqn0N8j8oY4k2q8mI/VRcZW3cWRrUeDd92NSaJBsFE2bE PcBZkIAg/JGCex55k24p3fNtkVwVRDY3xqFF3g6ajMr2P3SjF4b/FymGZOB7Ki3ZBgqV xo2w== X-Gm-Message-State: ANhLgQ1/DEhqvfbKel6iSo0nf/M0lrHlUGKP2FuzmK+u5DQp+praFdQh GIoncAvcVtUNA3KmB6p1WmSuW2LXSGRvnA== X-Received: by 2002:a17:90a:be0c:: with SMTP id a12mr2651608pjs.26.1583857963999; Tue, 10 Mar 2020 09:32:43 -0700 (PDT) Date: Tue, 10 Mar 2020 09:31:50 -0700 Message-Id: <20200310093101.1.Iaa45f22c4b2bb1828e88211b2d28c24d6ddd50a7@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog Subject: [PATCH] Bluetooth: mgmt: add mgmt_cmd_status in add_advertising From: Manish Mandlik To: marcel@holtmann.org Cc: Alain Michaud , linux-bluetooth@vger.kernel.org, Miao-chen Chou , Joseph Hwang , Yoni Shavit , Manish Mandlik , "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Joseph Hwang From: Joseph Hwang If an error occurs during request building in add_advertising(), remember to send MGMT_STATUS_FAILED command status back to bluetoothd. Signed-off-by: Joseph Hwang Signed-off-by: Manish Mandlik --- net/bluetooth/mgmt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 1002c657768a0..2398f57b7dc3c 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -6747,8 +6747,11 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev, if (!err) err = hci_req_run(&req, add_advertising_complete); - if (err < 0) + if (err < 0) { + err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, + MGMT_STATUS_FAILED); mgmt_pending_remove(cmd); + } unlock: hci_dev_unlock(hdev); -- 2.25.1.481.gfbce0eb801-goog