From patchwork Fri Nov 6 11:26:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7568331 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B55399F4F5 for ; Fri, 6 Nov 2015 11:26:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C630720721 for ; Fri, 6 Nov 2015 11:26:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E515A20729 for ; Fri, 6 Nov 2015 11:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161171AbbKFL0d (ORCPT ); Fri, 6 Nov 2015 06:26:33 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:38802 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161067AbbKFL0c (ORCPT ); Fri, 6 Nov 2015 06:26:32 -0500 Received: from ayla.of.borg ([84.195.106.123]) by albert.telenet-ops.be with bizsmtp id eBSV1r00f2fm56U06BSVQT; Fri, 06 Nov 2015 12:26:29 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1ZufA5-0000U0-AH; Fri, 06 Nov 2015 12:26:29 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1ZufAD-0006lq-ET; Fri, 06 Nov 2015 12:26:37 +0100 From: Geert Uytterhoeven To: Lauro Ramos Venancio , Aloisio Almeida Jr , Samuel Ortiz , Christophe Ricard Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] NFC: nci: Fix error check of nci_hci_create_pipe() result Date: Fri, 6 Nov 2015 12:26:34 +0100 Message-Id: <1446809194-25993-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP net/nfc/nci/hci.c: In function ‘nci_hci_connect_gate’: net/nfc/nci/hci.c:679: warning: comparison is always false due to limited range of data type In case of error, nci_hci_create_pipe() returns NCI_HCI_INVALID_PIPE, and not a negative error code. Correct the check to fix this. Signed-off-by: Geert Uytterhoeven --- net/nfc/nci/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index 2aedac15cb592353..a0ab26d535dca749 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c @@ -676,7 +676,7 @@ int nci_hci_connect_gate(struct nci_dev *ndev, break; default: pipe = nci_hci_create_pipe(ndev, dest_host, dest_gate, &r); - if (pipe < 0) + if (pipe == NCI_HCI_INVALID_PIPE) return r; pipe_created = true; break;