From patchwork Thu Jan 7 13:28:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 7977461 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB9EABEEE5 for ; Thu, 7 Jan 2016 13:29:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E17E72014A for ; Thu, 7 Jan 2016 13:29:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0706D20103 for ; Thu, 7 Jan 2016 13:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752512AbcAGN3O (ORCPT ); Thu, 7 Jan 2016 08:29:14 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:51353 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbcAGN3N (ORCPT ); Thu, 7 Jan 2016 08:29:13 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O0L005CM44M5190@mailout4.w1.samsung.com>; Thu, 07 Jan 2016 13:29:10 +0000 (GMT) X-AuditID: cbfec7f4-f79026d00000418a-d3-568e6826ce16 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 68.1E.16778.6286E865; Thu, 7 Jan 2016 13:29:10 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O0L008C044JVC40@eusync3.samsung.com>; Thu, 07 Jan 2016 13:29:10 +0000 (GMT) From: Andrzej Hajda To: Kalle Valo , Shahar Patury , linux-wireless@vger.kernel.org (open list:TI WILINK WIRELESS DRIVERS) Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] wlcore: fix error handling in wlcore_event_fw_logger Date: Thu, 07 Jan 2016 14:28:50 +0100 Message-id: <1452173330-19963-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsVy+t/xq7pqGX1hBtd/KVncWneO1WLjjPWs FotWLmSzuLxrDpvFmxV32C3WHrnLbnFsgZjFgwOfmRw4PC739TJ59G1Zxehx/MZ2Jo/Pm+QC WKK4bFJSczLLUov07RK4MhZOfMVYsJW94suxlYwNjOvYuhg5OSQETCQOHj3KCmGLSVy4tx4o zsUhJLCUUaJjxmUWCKeJSeLbuqXsIFVsApoSfzffBOsWEehjlDh2wAekiFngM6PE5y/vmEAS wgKuEvP3XGUGsVkEVCX27rwF1sAr4Czx6fF2Foh1chInj01mncDIvYCRYRWjaGppckFxUnqu oV5xYm5xaV66XnJ+7iZGSJh82cG4+JjVIUYBDkYlHt6OtN4wIdbEsuLK3EOMEhzMSiK80l59 YUK8KYmVValF+fFFpTmpxYcYpTlYlMR55+56HyIkkJ5YkpqdmlqQWgSTZeLglGpgVJR/YKPX kfhoWZ9PmERb7oKrEozL2y4ZaF9dMYvh+3s+gbu1yZd5py15398VdKzF6KkAc6hdasGl++zW IXP4tcRa+tf6LBJ8LSR2OqKs4NRuz5S5wguYFOJzX7KplNy7ynxgp0fyErm66a+nLhNxqtb8 eEy/TFeiiDfBgCH+1qplen9dV/1UYinOSDTUYi4qTgQACczRVg8CAAA= 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, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 wlcore_read/wlcore_write can return negative values so it should be assigned to signed variable. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2120705 Fixes: 3719c17e1816 ("wlcore/wl18xx: fw logger over sdio") Signed-off-by: Andrzej Hajda --- drivers/net/wireless/ti/wlcore/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c index c964054..4b59f67 100644 --- a/drivers/net/wireless/ti/wlcore/event.c +++ b/drivers/net/wireless/ti/wlcore/event.c @@ -38,7 +38,7 @@ int wlcore_event_fw_logger(struct wl1271 *wl) { - u32 ret; + int ret; struct fw_logger_information fw_log; u8 *buffer; u32 internal_fw_addrbase = WL18XX_DATA_RAM_BASE_ADDRESS;