From patchwork Sun Nov 6 15:28:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 16155 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1556788wru; Sun, 6 Nov 2022 07:50:49 -0800 (PST) X-Google-Smtp-Source: AMsMyM4QHOx9Y+lZpIxcpTp0Af5FGiejSFixFluEq0XznVcPX/PN0PoCa46bDqLtxQPoJjz0/Fii X-Received: by 2002:a63:5707:0:b0:46e:b83b:6084 with SMTP id l7-20020a635707000000b0046eb83b6084mr40131508pgb.233.1667749849661; Sun, 06 Nov 2022 07:50:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667749849; cv=none; d=google.com; s=arc-20160816; b=jR/MaimQt8Y90EUETe5NqPsRHNpi4xZEm2kq4+ccyB3oMY1zJC+6yLm1aNFblIyzzB 1tCyoPkD70/qnsvtT4yT9+vIeh8h5RzMuzTCVCN4Wudd2DEIcjPNho1lWLGbuzkgiPQV 1+5PUb5yArdJqVU0RPFNvIxvZxBgKHwlhtJ/rNp8TK95U2PZBfWYVVfTqiGe4YuaO4gk ewFdzVsHX7wisAsc86uS5sCaDcKU9zgR4NGNm2MLsy9yxt7qSCKZ9Ds5XQJ9ELqSu6yk DNHk6QypGaivr1dSdKw0ubx5FbzDekxprZ9hRDvQBdc60wSw8yE1Udu3vCStMLtZEdEn 5AhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=F/2rNbBxb5UGx2uf3u/3uDgglC8EUOBqMUbxeLLWQYA=; b=eX/sIv5dgPoDhcAdzhSAAQeJdSjPZF3Nudi0I+c/4RNKJ/Gpr5PjHYSiSGveYVFKUJ KTnQ3qkVB4zSZJqyzZpwihFX56g7yzAFGDEVvm5iUQycn3X3AJPejogFiZlvje8s4Hyg /UVgd6p+d54w1C82ht+hcDcnKwCLbJmHk68FjE6aAUuFteyLxF3LgZJ8CR6Swr8ix1v1 ukYAnq2iSqts+hrK9PcMzUAO9R03bpndyV/V6k/DFZs1/mboElOQSUTQtdfbwtIt3vBb 9JMoygHoQzcve9WRwS4h8T6ufgwjfQDDn09YGREI+jyDU5UhBQLhyCzEv0JAv2b9DuYj buhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b0044601bb2f90si6260492pgw.530.2022.11.06.07.50.37; Sun, 06 Nov 2022 07:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230105AbiKFPdi (ORCPT + 99 others); Sun, 6 Nov 2022 10:33:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbiKFPdg (ORCPT ); Sun, 6 Nov 2022 10:33:36 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0619DBC1F for ; Sun, 6 Nov 2022 07:33:35 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 6 Nov 2022 23:28:44 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.29] Date: Sun, 6 Nov 2022 23:28:44 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: benh@kernel.crashing.org, mpe@ellerman.id.au, gregkh@linuxfoundation.org, sohu0106@126.com, christophe.leroy@csgroup.eu Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] macintosh/adb: Fix warning comparing pointer to 0 X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <2ef267c.c4.1844d8ef2d8.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCXq+Gs0mdjLYwBAA--.53W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQACB2FEYx0CzgAIsb X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748762466719149269?= X-GMAIL-MSGID: =?utf-8?q?1748762466719149269?= Fix the following coccicheck warning: drivers/macintosh/adb.c:676:14-15: WARNING comparing pointer to 0. Signed-off-by: KaiLong Wang --- drivers/macintosh/adb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 1bbb9ca08d40..076253599bd4 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c @@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file) goto out; } state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); - if (state == 0) { + if (state) { ret = -ENOMEM; goto out; }