Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1104540img; Mon, 18 Mar 2019 23:59:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2QFA/HelxGF2RZ28UCqZ0ywWbffVaom0VyS1269Rje/pK9VKwoVblDkAHS7Q+6UG2Qztl X-Received: by 2002:a17:902:2702:: with SMTP id c2mr467884plb.239.1552978760056; Mon, 18 Mar 2019 23:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552978760; cv=none; d=google.com; s=arc-20160816; b=gQIQ//c5t0kHwLj87vQRnTNeyH3xkehro8oAWY0YHqJwUejs/rgS7vdaMUXFGCkThY RtiByjhAcS4WAAV9aGgtzwap2y8ll4hLSLmn5saj4Yop0spXJw2AbEwxQGcKlXBVED+/ 2W1PZRSI9m3gtQlTwj4rygNHYLWUfQdux2PjVClRBw9asirvRen+oPuZp50TfAJ1GYTs 9de7kmX4UAC4CQxcCCnG217ubmVagB2R1qbeBouimhVJAOk5XZcc9wLzeoLsoLGCiNZV NgFiJ7zGiz4EXDb0hvn3/rq46aSvLm9RUat7iDZ5kItUL0bL3zNud5hzz/v4jtRcZado ytGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=QuhZA/BCay0nyAbNEd3mONvKNQkrEEDd5oVNr1CJN5Y=; b=URPxKRtzFCZwhOE0FudESvgff35djwiOAxaeYTp4TAkKCyOVz8LvFlEBQSO+1Av1kZ 3fcleYY+D7AE0MIyLBZ7qvgdD/lUMvExNi3EkyVMerT+sB9tMKm7qQOtmMP4fmaKmyfL FvbMFi86CR22/VOSbVEF7iw8CCjwlipl+zCXEYisBoU5g/sikcVpzHGWRSL+PH9XVTjD R06OlYVnoH2p+du5QEmM5X34LmYldhbNUnnbaOESvZPfWKRShhQHmeRc1RmYloCOgrbA 5uPSGmFAgZegvZjlm7eJ7SHPWTKQ4pYMR3bROfWHyR4nJRDY2NMKLFRsgcqKI8qMTDl8 DGyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si11277402plt.120.2019.03.18.23.59.05; Mon, 18 Mar 2019 23:59:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbfCSG5L convert rfc822-to-8bit (ORCPT + 99 others); Tue, 19 Mar 2019 02:57:11 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:47481 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbfCSG5K (ORCPT ); Tue, 19 Mar 2019 02:57:10 -0400 Received: from marcel-macpro.fritz.box (p4FEFC449.dip0.t-ipconnect.de [79.239.196.73]) by mail.holtmann.org (Postfix) with ESMTPSA id AA9A9CF187; Tue, 19 Mar 2019 08:05:08 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH v2] Bluetooth: btmtksdio: fix uninitialized symbol errors in btmtksdio_rx_packet From: Marcel Holtmann In-Reply-To: <741bf172b7d0b77e664e7edeab1bd798c955cc5b.1552942432.git.sean.wang@mediatek.com> Date: Tue, 19 Mar 2019 07:57:07 +0100 Cc: Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <8DD976C7-5512-4228-ADC1-62AE2A3921A1@holtmann.org> References: <741bf172b7d0b77e664e7edeab1bd798c955cc5b.1552942432.git.sean.wang@mediatek.com> To: Sean Wang X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, > Fixed all the below warnings. They would probably cause the following > error handling path would use the uninitialized value and then produce > unexpected behavior. > > drivers/bluetooth/btmtksdio.c:470:2: warning: ‘old_len’ may be used > uninitialized in this function [-Wmaybe-uninitialized] > print_hex_dump(KERN_ERR, "err sdio rx: ", DUMP_PREFIX_NONE, 4, 1, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > old_data, old_len, true); > ~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/bluetooth/btmtksdio.c:376:15: note: ‘old_len’ was declared here > unsigned int old_len; > ^~~~~~~ > drivers/bluetooth/btmtksdio.c:470:2: warning: ‘old_data’ may be used > uninitialized in this function [-Wmaybe-uninitialized] > print_hex_dump(KERN_ERR, "err sdio rx: ", DUMP_PREFIX_NONE, 4, 1, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > old_data, old_len, true); > ~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/bluetooth/btmtksdio.c:375:17: note: ‘old_data’ was declared here > unsigned char *old_data; > ^~~~~~~~ > > v2: Remove old_len and old_data because the error path for sdio_readsb also > seems wrong. And change the prefix from "mediatek" to "btmtksdio". > > Fixes: d74eef2834b5 ("Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices") > Reported-by: Dan Carpenter > Reported-by: Marcel Holtmann > Signed-off-by: Sean Wang > --- > drivers/bluetooth/btmtksdio.c | 10 ---------- > 1 file changed, 10 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel