Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1511926rwb; Wed, 5 Oct 2022 00:12:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6imeMQ7StKw/yigeodYRTdhi39ro5zYflzJ8dwL9dq8k5QVylRrzjxJhiwQEm3/VsRerdh X-Received: by 2002:a05:6402:51d1:b0:451:ea13:1583 with SMTP id r17-20020a05640251d100b00451ea131583mr26728625edd.322.1664953937437; Wed, 05 Oct 2022 00:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664953937; cv=none; d=google.com; s=arc-20160816; b=ComXkLWyxyOyfa7s4guq1Tc6YPML8RPwqelGiR/rl3FzKyvjcnuI/mFonqXvuPVpl5 pVSlQZa8zUIGrUUy/kzCBXXUnAWnFGxELh2wfPXnxVRRpzPAeKvFbrY5g4J4zOb2kPtH JOo+qyV1mT74QeNE973lhUpuS2CwnibYavVmKxIXeI8GUAx1Hrah3UN7hHuqMZy/ajYH Ov+Gg8RBrID0ZiLoJBqJ8n70GFH6tD/cDUFg+/4HeXiMHkINsTAuii3y73MOh7FlsOhj QPBPBjQ/XO2Sc2VBKrZ2d+vNQYm0jIZzsN9aM0d53tFpvvKf2S3SYHMQ0osD5aZUqMaM WLlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=0kv7LZbwVvvTCY0FDOB7BWqbGQ4uCTTTGBzanUoZ/5c=; b=EbvXjxYbJWnJHLO7HI0+qZ0rYJ/HJ4uz52sHRVJzoy2PhRiemMgGqwcEf7BLti+T0u kxeJGn2/LzkeFHlyNC5/EKSkk5+tbmW2nvIuxFs0D2GtofAtJfVuljGtzdwQpIspkRqc orG56qbW2D2doHfkNAFLkrp7g4C7ActyCT9u8757fYzkp8myeOTKGaCUxjDYaR4mEP9o Py+PeNTqCJ7HZ2NVto/ROV/ZwG02VOcAd7qIDAjtJTufDjYKFuu8F+NF2ERw+7rfwoAw 9eq5uBTLIWZBQd6ORXtA3IEPStRF9LHvWJgGnUKTrNPmoVr2jLY2QY9FihCHKj85acnk 9gxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FxjCN8ME; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg9-20020a170906f88900b0078d231cedb0si2137802ejb.194.2022.10.05.00.11.49; Wed, 05 Oct 2022 00:12:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FxjCN8ME; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229551AbiJEHKB (ORCPT + 99 others); Wed, 5 Oct 2022 03:10:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiJEHJ6 (ORCPT ); Wed, 5 Oct 2022 03:09:58 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC11BCE2D for ; Wed, 5 Oct 2022 00:09:55 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id h4-20020a5b02c4000000b006bc192d672bso15485067ybp.22 for ; Wed, 05 Oct 2022 00:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=0kv7LZbwVvvTCY0FDOB7BWqbGQ4uCTTTGBzanUoZ/5c=; b=FxjCN8MEoO/P7TtrDCci6qecuNe+mYvoZwwIqXh+ZFVTP9pYumPENqeRRVX1V57FGt VmIhuBShQ85+xuhfo0OJnvaY6jh6xm1uotVlGCTndMdcs7UCmW1WAr0h4F70uMgWMuHH k3Nk+0Q+JLMBV1jELcfeZ78+i74EuDU/xV6DFKsThsGjRsnecnMWhQS44hlzs+JMVg8x 9C6f7nQYTmLbYrhnzMUnkSV/gp2YYiGbRQULv4uG6DMgfHXzMUFsn/AVzv7c/JJdPDPv L818cWJ9KOkXTuoXzFyaVhbpFcknI8CnlKiAI7vw+KTQPs6JtDBYUwqXOMHPg2V1MIwK mMMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=0kv7LZbwVvvTCY0FDOB7BWqbGQ4uCTTTGBzanUoZ/5c=; b=d2bXhtRvrRMNZG97WmiUPMG56aC8cVjhRSFjp236gTVoLczIaUuIVAAHHdlD0v+Het 5q205UuGAWk7NY5gBFkJ1Q2LCjha7l/4ynt7G1bPeSiK9SBWr7nr69fpVDaCcMyjncLo aVHf74ktRuxah11WpsPmsu+QjnoHONJzqm3IF0tIDiQorHhAHDAQF2H5ffCXiZu5S92a 8HXmp6o1BRftfPfmhmR+W+gZX7E76j+aHxsQXMwLQ6tI5z0+cJTqro/9L41w+eyegsOK L7Ht5yNqD698vU6qzWVPN8Azp9iQ5aP+dTeZakf0+09S57uSLo7Hbb7ngL6lOOYVwlx4 3dlg== X-Gm-Message-State: ACrzQf0KqNNSzefHb6oMWTrC+K5L9m7MOO5cSh1q2kqEha96Ro2FfObh LRzeQFhCdyPWxok+oHhWfVfw1GRp2uAJCssILBv13p85D6OqAWb3Gdm/ioyRq/iOuVX9NqFU6cv 5CsAn4OxzWdmkxADZGmWVISEsB1LNUo4qMT87PuHopAjob7yoL12NgxgV/u8hVdmD2Aa+HG2pBP rW X-Received: from apusaka-p920.tpe.corp.google.com ([2401:fa00:1:17:499:ff69:2084:388d]) (user=apusaka job=sendgmr) by 2002:a05:6902:1083:b0:6b1:4a11:9cf5 with SMTP id v3-20020a056902108300b006b14a119cf5mr29727673ybu.537.1664953794404; Wed, 05 Oct 2022 00:09:54 -0700 (PDT) Date: Wed, 5 Oct 2022 15:09:47 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog Message-ID: <20221005150934.1.Ife932473db2eec6f0bc54226c3328e5fa8c5f97b@changeid> Subject: [PATCH] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed From: Archie Pusaka To: linux-bluetooth , Luiz Augusto von Dentz , Marcel Holtmann Cc: CrosBT Upstreaming , Archie Pusaka , Abhishek Pandit-Subedi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johan Hedberg , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Archie Pusaka If a command is already sent, we take care of freeing it, but we also need to cancel the timeout as well. Signed-off-by: Archie Pusaka Reviewed-by: Abhishek Pandit-Subedi --- net/bluetooth/hci_sync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 76c3107c9f91..a011065220e4 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -4696,6 +4696,7 @@ int hci_dev_open_sync(struct hci_dev *hdev) hdev->flush(hdev); if (hdev->sent_cmd) { + cancel_delayed_work_sync(&hdev->cmd_timer); kfree_skb(hdev->sent_cmd); hdev->sent_cmd = NULL; } -- 2.38.0.rc1.362.ged0d419d3c-goog