From patchwork Thu Jun 16 04:19:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasun Maiti X-Patchwork-Id: 9179811 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA8CD60760 for ; Thu, 16 Jun 2016 04:20:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC2031FFC9 for ; Thu, 16 Jun 2016 04:20:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE2B327E5A; Thu, 16 Jun 2016 04:20:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B971FFC9 for ; Thu, 16 Jun 2016 04:20:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750984AbcFPETr (ORCPT ); Thu, 16 Jun 2016 00:19:47 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35538 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbcFPETq (ORCPT ); Thu, 16 Jun 2016 00:19:46 -0400 Received: by mail-pf0-f194.google.com with SMTP id t190so3087215pfb.2; Wed, 15 Jun 2016 21:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Apxr4ahg0WCpckCqmC/8pc8jmLOrEC+8ziHG+tdmEbs=; b=rdJU6qmJZfxVWuISEOmlnPx+KUwZxomNcmASpNJnCs+wxF+PQCPk91chhZMKclonEw CVXnLqgiAB051RvhWLfYfXXJtvm4G88HcNddIPTUuPkWZuRBzR818tcvg8ZchM5cFiFc 51u7iONsKJXQ1Bncr7XfBwppi2p+HX5oIb2tYjAFikiFaETDRAy1qoZAjKPoe8ZDHwUw Pum4Bewv4HuiZInnjef0KstZCZTzAkQZCz/1nleWFRKAJ6CyEg2UDlks+3bXaHdpt6tB L6YSu0c3sjXViK1ozT95RzXN5Pqr69iX5r1jyS6doLYtbZrzmVE7oBd5OKnSPveSY2cz hGmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Apxr4ahg0WCpckCqmC/8pc8jmLOrEC+8ziHG+tdmEbs=; b=PVQNPT3NJm4E5sPfFFbd/ZCfEl1KTf8NMGbV5CePM36qnsD1l3MaUbYj6G6ui2EyX5 qtsMxGjt1eKZKHZutdgHnrxo4qTMwvTlOg/pdZ2xq/txUJHPYIyJxtkuREofc0hqTpMC +HNNRbf5COYzhB2F2ysZpzlr6Cchj2uAL1isNNF7d7zofKL/ELWAedKHY6vdqFmWEF7Q UrTCo6uUGY3jm4DFYAh7LUVxT8H8kqhs/ihuV0WGGF2Xxqa84SKT2W5U2JU8Ce/j8H/q xWGEWJzEDGKu/yXBBPZnhPvnF9237Trtml6ojoPascW+RjL1VDfTeMdVdGnUJNphRwT2 TuzQ== X-Gm-Message-State: ALyK8tLIg887QpoAIgCqjYQKmjPx0CvarEHF5MTjG8eMKJMjcac799nrq534qHDti0TMxA== X-Received: by 10.98.34.15 with SMTP id i15mr2680534pfi.29.1466050785230; Wed, 15 Jun 2016 21:19:45 -0700 (PDT) Received: from asl--078.alumnus.co.in (gw.alumnux.com. [182.74.215.94]) by smtp.gmail.com with ESMTPSA id 78sm45246730pfm.43.2016.06.15.21.19.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Jun 2016 21:19:44 -0700 (PDT) From: Prasun Maiti To: Amitkumar Karwar , Nishant Sarmukadam Cc: Linux Wireless , Linux Next , Linux Kernel Subject: [PATCH] mwifiex: Fixed endianness for event TLV type TLV_BTCOEX_WL_SCANTIME Date: Thu, 16 Jun 2016 09:49:30 +0530 Message-Id: <1466050770-21789-1-git-send-email-prasunmaiti87@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The two members min_scan_time and max_scan_time of structure "mwifiex_ie_types_btcoex_scan_time" are of two bytes each. The values are assigned directtly from firmware without endian conversion handling. So, wrong datas will get saved in big-endian systems. This patch converts the values into cpu's byte order before assigning them into the local members. Signed-off-by: Prasun Maiti --- drivers/net/wireless/marvell/mwifiex/sta_event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c index 0104108..7dff452 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_event.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c @@ -474,8 +474,8 @@ void mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv, scantlv = (struct mwifiex_ie_types_btcoex_scan_time *)tlv; adapter->coex_scan = scantlv->coex_scan; - adapter->coex_min_scan_time = scantlv->min_scan_time; - adapter->coex_max_scan_time = scantlv->max_scan_time; + adapter->coex_min_scan_time = le16_to_cpu(scantlv->min_scan_time); + adapter->coex_max_scan_time = le16_to_cpu(scantlv->max_scan_time); break; default: