From patchwork Wed Jan 11 20:39:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9511305 X-Patchwork-Delegate: johannes@sipsolutions.net 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 212686075C for ; Wed, 11 Jan 2017 20:44:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10B4528601 for ; Wed, 11 Jan 2017 20:44:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0408D2867A; Wed, 11 Jan 2017 20:44:01 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 AF63828601 for ; Wed, 11 Jan 2017 20:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932200AbdAKUk4 (ORCPT ); Wed, 11 Jan 2017 15:40:56 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:62014 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752133AbdAKUjp (ORCPT ); Wed, 11 Jan 2017 15:39:45 -0500 Received: from wuerfel.localnet ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPSA (Nemesis) id 0Mfe8p-1c7OcQ1Mvz-00P6d2; Wed, 11 Jan 2017 21:39:09 +0100 From: Arnd Bergmann To: Johannes Berg Cc: linux-wireless@vger.kernel.org, "David S. Miller" , Networking , linux-kernel@vger.kernel.org Subject: Re: [PATCH] wext: handle NULL exta data in iwe_stream_add_point better Date: Wed, 11 Jan 2017 21:39:07 +0100 Message-ID: <3292373.oxnXTOSWCQ@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1484147177.29931.14.camel@sipsolutions.net> References: <20170111143532.485827-1-arnd@arndb.de> <1484147177.29931.14.camel@sipsolutions.net> MIME-Version: 1.0 X-Provags-ID: V03:K0:eGbC7lTsSD8tcUM/9z2v+n3amjzE59V+wDbgkXav7oMLoAklnjN QVVbaGAu4dJ+niUIbG2hg6+wXhVslFa29cDwnFsYAe+uXH05gAZihSyPvSdCo4GDdg11uK7 zEw6zBmr+mHjud6CTIkaaGvZt2bGbhT+um7l5664Tb40jkKUjMEdY5ScFO3KS+RcMzPTZIc 8PrS7y/sepsmsHJAEHrUg== X-UI-Out-Filterresults: notjunk:1; V01:K0:EuJZqgXl+XI=:I5LeMHSeuHEyyTEcl0RpuA C6yeMaK1YmhtgZxg2ZAxpcV609FMixKTjQWXqobl4uOiN9JUdLhlv7RQTbDv4a6Cw4vM3WD/j BOACYvVjXTG0Y5dsvUXtrqQ2diloU303BcNsEVlVpuumTQ7itKARKsnEPbcu9jg6ZYNA+uqMx rB4TCEqfd2dKsX69fC37/AgfYNOl8Oxq/dzll8zkTMnK8XrSM9QzDZH6rWERgQMTVGqsP2lwt Z5XNCNlCscQ6eOrxh2gOont8FsnGGL+R5n95ZVSbIzACsqAUf91D7WSCac2BMmXBRlESDpBTb fYhtjmXdiKRAZET55lSK5lStpp8Jet6bAKv40Sclu5z5GhFUVgTveQWIiOi8f779Hyb3kglBb tacIgcxPtyMq2guJZYm8g7Lk/j2PNBP7370axLyDBhz5b2LvzhxF7Rs5LMLy52hUsH5gMQtsP 22jTBfG30xk/f+KXiGpHz5LCqx3V7AcqiP/qIJtwxCm7OYtvjxHkmH7mYLWnbMuf0+CnxpKOG xXDK8EVDrzfSJ1M009i5hzn1vlOqW34AXcVlSEFCGCeZ4Va+qLRKt60r7GP/lGQt5kqNJbgUZ UMaxuCbNU54Mkx4wj42+whiAYxcVS4FGLMLAm6pkPjJOMke4ATJDi1H7tgnnuPYtNZiu1eMb+ hdc7/69QoUSVpFtfw+9k88qisHeyhuBdH7hAQ8nnfAyLbNCmEoFOUqsSY9NW0hPqvkpO1ioO9 l8SRqtZklaOIYZL2 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 On Wednesday, January 11, 2017 4:06:17 PM CET Johannes Berg wrote: > > Applied. Also fixed the typo in the subject :) Thanks! Unfortunately I now got another warning for the same function, and though I would have expected the patch to fix it, that did not work: In file included from /git/arm-soc/drivers/net/wireless/intersil/prism54/islpci_dev.h:27:0, from /git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.h:24, from /git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.c:32: /git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.c: In function 'prism54_get_scan': /git/arm-soc/include/net/iw_handler.h:560:4: error: argument 2 null where non-null expected [-Werror=nonnull] memcpy(stream + point_len, extra, iwe->u.data.length); The change below kills that warning too, but it gets even uglier there: Let me know if you want a proper follow-up patch, or if you can amend your commit, or you have a better idea for resolving that warning. Arnd diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 1a41043688bc..c2aa73e5e6bb 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h @@ -556,7 +556,7 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends, memcpy(stream + lcp_len, ((char *) &iwe->u) + IW_EV_POINT_OFF, IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); - if (iwe->u.data.length) + if (iwe->u.data.length && extra) memcpy(stream + point_len, extra, iwe->u.data.length); stream += event_len; }