Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4416894imu; Mon, 7 Jan 2019 23:08:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4y7DkwnYHlFlNUzsDXt9wyOMATXu3zcBgwyEpzIOBgHiEExmu0rSX0/MZht7PvKI/fs9VZ X-Received: by 2002:a63:6a05:: with SMTP id f5mr545819pgc.72.1546931301744; Mon, 07 Jan 2019 23:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546931301; cv=none; d=google.com; s=arc-20160816; b=Mgn5m5t6XuSg9IeznX70gtczXGzO7FUxX/1kTBipcdKReBTWW+XflJYcxpbEby0FUE hJ0TT+oBjDVb7tULy79ehf3kaHF8sLGtSeAmvbpdNPM+tNPKSXKTr0k1b0xg0XZ/gqcH XftgOUoj0ksGX/lZSe6usOTb7AjWbf/lt3cvLCOkORRufTMUnewlV65h/BAxbiyv80/K WKFfv8pbnoSD6UByqCAEz5icrMKySZf8ERGmXBxW77wXJA3E7nyFQEpDEEpBDV2dn4X0 AxY7knrLs2I2CgE7rnntYxIWdA2BichPZZ9+igjDYj8zS/tPpFnVyB9ti0wImH1vQCAQ dBFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=dnt+lEkM4qUxeXELPtyNtc9tBbvuc3ElsgZSfjdQa+I=; b=iJRkAzBudrRwegl6m/YLs4BpEfEafxpSD8SKzf7NImUQLpsEcOTn5k3IC6YNIKVNEU 2krd/DLfUZIPYVQw3U5e2k+Iyx1TTVuJwCjABChAydbtP8JSxtLOCjREerip3jFR7q0E X25JMOnZvAgNfaK07ATHyDu5Cjf2eor7obXtXdCrBByKp1yqiBObkrnSlM/o5P4hhfuw EgYdZfGP6/Ec4TUQBT+EzlEEWyual3eWvIJTKqQXcFn4v+9BbdeocCBlNpEClZFsOHow wvVKC0rTY3A5IXHjr+im/Hr1s4jiMlTvTya9Lv9Nhe/5mBEk04ez8Two6wNuEZxpmKfV Su9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=UTRPgSdd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si70120773pfd.86.2019.01.07.23.08.04; Mon, 07 Jan 2019 23:08:21 -0800 (PST) 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; dkim=pass header.i=@163.com header.s=s110527 header.b=UTRPgSdd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727678AbfAHHFm (ORCPT + 99 others); Tue, 8 Jan 2019 02:05:42 -0500 Received: from m12-12.163.com ([220.181.12.12]:39861 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727435AbfAHHFl (ORCPT ); Tue, 8 Jan 2019 02:05:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=dnt+lEkM4qUxeXELPt yNtc9tBbvuc3ElsgZSfjdQa+I=; b=UTRPgSddjUbVY/8BGkQQW6VjBPnI3h4Oe6 I+fziQEfqM7xePd95RjLe023aX684arMWBVCMKRjMrzSe9BdxjGGV29pGQnEZ8bN bbjN9nwMmGFeT9FGL7txBrAzHvpShOPGNAI1UUuZaj2bBkLpEtTfNW/15AWAfAEP 7SyyqZlIE= Received: from localhost.localdomain (unknown [222.212.97.202]) by smtp8 (Coremail) with SMTP id DMCowAA3hrDASzRcRVU+JA--.51699S2; Tue, 08 Jan 2019 15:05:36 +0800 (CST) From: wangbo To: linux-kernel@vger.kernel.org Cc: sameo@linux.intel.com, linux-wireless@vger.kernel.org, wang.bo116@zte.com.cn, wangbo Subject: [PATCH] NFC: fdp: Use signed max_size to catch fail Date: Tue, 8 Jan 2019 15:05:33 +0800 Message-Id: <1546931133-27462-1-git-send-email-wdjjwb@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: DMCowAA3hrDASzRcRVU+JA--.51699S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKF47ur18Cw47tw1fCw1ftFb_yoW3WrcEkr y5Wr13Wr1YkFnavry7Wryavryj9r17XFs5WF1YgasrAayDAF43uF4qvryfWr1fW340v3W3 KwnrJr4rAr4qgjkaLaAFLSUrUUUUxb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5cvtJUUUUU== X-Originating-IP: [222.212.97.202] X-CM-SenderInfo: xzgmy4re6rljoofrz/xtbBEgE2GVZX-qQLEAAAs8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The variable max_size's type is unsigned char,can not catch error number, change it to signed int. Signed-off-by: wangbo --- drivers/nfc/fdp/fdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index d5784a4..ba32a59 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -192,8 +192,9 @@ static int fdp_nci_send_patch(struct nci_dev *ndev, u8 conn_id, u8 type) const struct firmware *fw; struct sk_buff *skb; unsigned long len; - u8 max_size, payload_size; + u8 payload_size; int rc = 0; + int max_size = 0; if ((type == NCI_PATCH_TYPE_OTP && !info->otp_patch) || (type == NCI_PATCH_TYPE_RAM && !info->ram_patch)) -- 2.7.4