Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3109354pxk; Mon, 7 Sep 2020 03:33:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbttsLTM96piQMA2eopFC9HwRkwy+/6VHojchYOSrjwr4ZGSEfLYPWdJ1WSthPBzNw/zFk X-Received: by 2002:a17:906:4e54:: with SMTP id g20mr21116823ejw.252.1599474796260; Mon, 07 Sep 2020 03:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599474796; cv=none; d=google.com; s=arc-20160816; b=e0GN50FvUN1WVtzBAZZHPzTU3XZK6ZE3gRXoT8obQ0C0PujekA8yOjlPm5d0eOW3nI RLSisHvVtfhGKdAXmR+bqbpgY5ewtrV2zH8yfRLfRHD2e8lEMzKnczrKO9usmRuhw08h m2CTwwr+KgmMPk4YYyHLPtGnKrUZdhXh3OczwW4FQA/V7r5Ljmig+/QZLENPvTQcWv9s JxowLYE57FTtMA0C4t0dvdDY5O6/rQue0NQsLHKCYSjeEQfRd2E0OuD/NNh5pPyMRaZX uWYLwVfpDk0s4/71xPFH9ccHJfdYwSPnuBGMY9tQrHVaN6teYAvDJRRerk5leIiGC+Zt utMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :message-id:in-reply-to:date:references:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=572UGXT/lSltpWjJcGBSalGSY9Ay1jWSsapHHh51IBw=; b=rCh5Rex+u664xYDzyxkc5lDzNxWQ6PbK/MBDobGacpBcZnfOTuRKah6vwF0bQa5bMk rZTjcgVeNT7J1Sfh5Yyl0z6yYVqfufBOaRVRzqeJIcGJuSjwDB7oOjgyFnp9fTVpgfyA QWhb5q0x/ozy8Nif/ru7pf5UfWHc+lfUAGIn9p2orZnMHo+xqM2ra1/bzI7NGOmQgLIE sCJQYRyNaTyV64ebw/AuYjVBpLLLvTxm+Qi6+h9iNsSe4R29AKhjutHYAIcigSAocvBa bd3WYAPlyQm6C9qr0sLVLRtfJ3Lv7D1GYwja4I5aPK8aAOB5qzxeuuCYux5b/tv2lcIn cfVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=ZcATHQxU; dkim=pass header.i=@amazonses.com header.s=hsbnp7p3ensaochzwyq5wwmceodymuwv header.b=OU781ct8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si6764525ejd.140.2020.09.07.03.32.51; Mon, 07 Sep 2020 03:33:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=ZcATHQxU; dkim=pass header.i=@amazonses.com header.s=hsbnp7p3ensaochzwyq5wwmceodymuwv header.b=OU781ct8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728942AbgIGK2M (ORCPT + 99 others); Mon, 7 Sep 2020 06:28:12 -0400 Received: from a27-56.smtp-out.us-west-2.amazonses.com ([54.240.27.56]:42630 "EHLO a27-56.smtp-out.us-west-2.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728186AbgIGK16 (ORCPT ); Mon, 7 Sep 2020 06:27:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=zsmsymrwgfyinv5wlfyidntwsjeeldzt; d=codeaurora.org; t=1599474478; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type; bh=1CMwxmjWB2IZZGpa5lLWkQ6WnBmJXHQnQxKcHtOHxqI=; b=ZcATHQxUV6IWJFMiyKON0Gp+qxAOPzwjD+hzx+rRrmmDDbDEtCfCJC5ZmPAdSt3u vn4BKDvPsuN181U4RLc/AyaqV2AxQ6oJylGkWqLP5xC14xnZgJcU52EyaiKAqPi1BIR ShcAXIX1ajtvzXwhs3uD6oC9qR29eZ+oz3eqjJ/Q= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=hsbnp7p3ensaochzwyq5wwmceodymuwv; d=amazonses.com; t=1599474478; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type:Feedback-ID; bh=1CMwxmjWB2IZZGpa5lLWkQ6WnBmJXHQnQxKcHtOHxqI=; b=OU781ct894PhTFB+H9WoiHUFFCGrbMHiwQsos0cDV0GdnBxykISQDSn9D6EF27kz bhaJO8FyJm5tGdWoeM5tc05mPdJLT/CDCnsTdIsxLh2iRge8pX9ir9+l1kElJ78T6LM 4gC52G4R3SmS3N5I4gm4r/ClDa8xQwyZZ7/IsetM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E1752C53A37 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Bo YU Cc: kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, rmanohar@codeaurora.org Subject: Re: [PATCH -next] ath11k: Add checked value for ath11k_ahb_remove References: <20200621095136.7xdbzkthoxuw2qow@debian.debian-2> Date: Mon, 7 Sep 2020 10:27:58 +0000 In-Reply-To: <20200621095136.7xdbzkthoxuw2qow@debian.debian-2> (Bo YU's message of "Sun, 21 Jun 2020 17:51:40 +0800") Message-ID: <01010174681bace8-5b83f615-4790-4722-8257-799205c9c96f-000000@us-west-2.amazonses.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SES-Outgoing: 2020.09.07-54.240.27.56 Feedback-ID: 1.us-west-2.CZuq2qbDmUIuT3qdvXlRHZZCpfZqZ4GtG9v3VKgRyF0=:AmazonSES Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org + rajkumar Bo YU writes: > Return value form wait_for_completion_timeout should to be checked. > > This is detected by Coverity,#CID:1464479 (CHECKED_RETURN) > > FIXES: d5c65159f2895(ath11k: driver for Qualcomm IEEE 802.11ax devices) This should be Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") But I can fix that. > --- a/drivers/net/wireless/ath/ath11k/ahb.c > +++ b/drivers/net/wireless/ath/ath11k/ahb.c > @@ -981,12 +981,16 @@ static int ath11k_ahb_probe(struct platform_device *pdev) > static int ath11k_ahb_remove(struct platform_device *pdev) > { > struct ath11k_base *ab = platform_get_drvdata(pdev); > - > + int ret = 0; > reinit_completion(&ab->driver_recovery); > > if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) > - wait_for_completion_timeout(&ab->driver_recovery, > - ATH11K_AHB_RECOVERY_TIMEOUT); > + if (!wait_for_completion_timeout(&ab->driver_recovery, > + ATH11K_AHB_RECOVERY_TIMEOUT)) { > + ath11k_warn(ab, "fail to receive recovery response completion.\n"); > + ret = -ETIMEDOUT; > + } This is a good find. Rajkumar, can you take a look if this is ok? > > set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); > cancel_work_sync(&ab->restart_work); > @@ -999,7 +1003,7 @@ static int ath11k_ahb_remove(struct platform_device *pdev) > ath11k_core_free(ab); > platform_set_drvdata(pdev, NULL); > > - return 0; > + return ret; > } Especially I wonder what happens if ath11k_ahb_remove() returns an error. Should we just print a warning and return 0 instead? -- https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches