Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp343606ybe; Wed, 4 Sep 2019 21:35:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFUch8/FqArsQHD1ObVdTnEJkzssuVpy/9XEmGFC94G9H+XaU0yB11tGvNOK5uJsTFA0u2 X-Received: by 2002:a63:5402:: with SMTP id i2mr1355340pgb.414.1567658125815; Wed, 04 Sep 2019 21:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567658125; cv=none; d=google.com; s=arc-20160816; b=MVrl1Gt8r9M03KitQLvEccLPZxS2ZuCc9xipR5pQ5qXD2Od7inhgBSTzGB4Ckyt6it nINa/7AKygAxNCrot8xVcznvJF1WRwLpJlXHDWh37fzz187cUuxc93O9zHpiGhkEQ91H DgnlVkstb2vRftg/9Vrmkons61t2DzAW2evruJ3nfGN6X0QT57Uk4wOkieFwDi7PsKIR gZ8P2GEEkMW+/Msi+jOTQ8H2+CgMHYsVVvzWpcmqDNyvD3pMYixm32lzSR3bbMfG4NTa MYnyYPqCX+VwfW7s7IlzHycz4/6+FCYbIT1ZdWItzyrlZx1hVHurygN/e107N86bXPJu tQ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=gyeTQ8VF+xJrRwrryS3jRd5ZrF+wSnavanKTNlsW8ks=; b=PdGtqqP/IFWcG6QrcglTcsM7jfAS2siFWKPblcOKrxRJJk/SkNIaesbWfjL6bpe9YS SHjZoYcHoYMD7Zfj6YVsd3ipgcb/FQ3ywKYCaA93au4J4M5wdOSioVHQj4cIdeHnaXWi 0FsvYVQSAXPKAVOCaiYMTzV3u+mXKaKoNqSw0sVeLnomaMVVjfXwpwOvn6CzZNFXgP+n HvO2GeHSEELNiP/XGoLwkhAHNp+xjbCxtO4gIzI7r9pdWpawHERBiiBOZ/d1hHjj0Qnz MF8yr36avKMzAMdyx14NamqCIMRq+Ya828TgKFMB2YIP7vg641YRcqa7M4nq4Rw1IZy6 K5tQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fh19si253027pjb.44.2019.09.04.21.35.09; Wed, 04 Sep 2019 21:35:25 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731115AbfIEE2n (ORCPT + 99 others); Thu, 5 Sep 2019 00:28:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6673 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729941AbfIEE2m (ORCPT ); Thu, 5 Sep 2019 00:28:42 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4BD539422B7EA727F921; Thu, 5 Sep 2019 12:28:40 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Sep 2019 12:28:32 +0800 From: zhong jiang To: , CC: , , , Subject: [PATCH] cfg80211: Do not compare with boolean in nl80211_common_reg_change_event Date: Thu, 5 Sep 2019 12:25:37 +0800 Message-ID: <1567657537-65472-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the help of boolinit.cocci, we use !nl80211_reg_change_event_fill instead of (nl80211_reg_change_event_fill == false). Meanwhile, Clean up the code. Signed-off-by: zhong jiang --- net/wireless/nl80211.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 3e30e18..0c7fa60 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -14997,12 +14997,10 @@ void nl80211_common_reg_change_event(enum nl80211_commands cmd_id, return; hdr = nl80211hdr_put(msg, 0, 0, 0, cmd_id); - if (!hdr) { - nlmsg_free(msg); - return; - } + if (!hdr) + goto nla_put_failure; - if (nl80211_reg_change_event_fill(msg, request) == false) + if (!nl80211_reg_change_event_fill(msg, request)) goto nla_put_failure; genlmsg_end(msg, hdr); -- 1.7.12.4