From patchwork Tue Oct 31 09:53:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 160064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp158957vqg; Tue, 31 Oct 2023 04:16:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5GmEFVKefF/vqX5ovxFSn6OjvfXIxcHDRiHJsBjtAOoqPxXaS/8XFy0X5u4vfTcscqHbf X-Received: by 2002:a17:902:dac4:b0:1cc:2518:ef02 with SMTP id q4-20020a170902dac400b001cc2518ef02mr2590872plx.14.1698751000087; Tue, 31 Oct 2023 04:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698751000; cv=none; d=google.com; s=arc-20160816; b=SInnknup+AV585u9tj3MnD6eYXHExWDMeCb2sUE/YZ1QLkjA4Iric53GzH1y6hT/Nr h3HlzCzfB68E5L/BOhaDXBZ1rTeiDHEFktdED31mgie37imAbM/HrfTkvZXZ0msnFy8t 8eGr5UdSUBMftv1o5MuOFZ87QOtT/fG7p9Kb6cWO75fwLXhnAEY757ID9jFh0fMCji+x zoXhF0oSMy+Zxg5LXPmKxc9Tz8EPi2fnjxGIpmb5iRxt6SbqC6v4FdVdQZBQj6Nx9NB2 9PDI2dbb58inry3DCwWNDD2uk+9qP12L7aX1aJh+tRYrfT4UXoivUPS2CbRg8jfKRyK5 SNtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=qWALiZD+LmJgzXNjW8ZH05nKNc7IXtVIX8FUs6lSTpo=; fh=X3MTGfnIHjNvPH72ftCU8OXDkMV9eIOKM8hp2cpMhPk=; b=gzs3x3Z10/xyTh2vgtmvyAi1iaKFXm0azI+3J+9p7htRJoSqEivsrs8er0aA+QNMSS 8dAzSncdc5FxBAHgUNXxpgFkvQYR5UmNYFO4XhdkZTslstnbDTewMMncg4t3Nv1DE/u7 DWp+Cs7eHATJuAYjKaUTtOaaL5bFb+xMcpZrU6A+zGE0I1mthGy1Vv6fFi9vgAQ9NpN7 npASoqP8dlrHynq0BAGWPhJzaqXIlF09fv05GFzO/RIGmKx5fVKk0ml1TXAeAz42jfvq FCT2Q2aPwY9oqENpJrTqPjt6e0zkEmzHHEjXDPse/FANnOkJ0Kuudkk8+vcumLFQgv1h MxTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RzHNCCpR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x15-20020a170902ec8f00b001cc45fcb81fsi911052plg.334.2023.10.31.04.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 04:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RzHNCCpR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 89EA98050634; Tue, 31 Oct 2023 04:16:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231197AbjJaLQC (ORCPT + 34 others); Tue, 31 Oct 2023 07:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236039AbjJaJya (ORCPT ); Tue, 31 Oct 2023 05:54:30 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA5312F for ; Tue, 31 Oct 2023 02:53:58 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c503dbe50dso78834111fa.1 for ; Tue, 31 Oct 2023 02:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698746037; x=1699350837; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=qWALiZD+LmJgzXNjW8ZH05nKNc7IXtVIX8FUs6lSTpo=; b=RzHNCCpRDGl9QEd7IqwaCc9hYr9IA7qwXQeozLN4KlQk7MaeyHJXg995kATOGkdBrd zJ/49TuYnzsJMESiva6E6DEUVNv9I8N9OpRXdJJyoyyA97FAnJKg3iMuRZd7SFqOc0P/ RWigy2pkHEqCjyyI5KZr51eEzFSmq7dIegk6gpNE/fFUsnc0mkRCL8jwA7ssgpZPdA4D XGOV4k8uuBrhnnqOoIjTY1LiAMdivh8CloZwywJiHHG0zBSCALdrTI36Y9Nebm4gHLet GTeJr5xjPXAJPTqAONQNI5biTnvgJ/dFXyuwHkFhaGu6X2ZU9dDig/LUDpXgrvNo5vF7 oARw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698746037; x=1699350837; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qWALiZD+LmJgzXNjW8ZH05nKNc7IXtVIX8FUs6lSTpo=; b=roTNwICzoCBKI1igUCpJVkI5k7cuDyzSzyysEa8uPpYDqzLlLgYJW27NRgdeJtruqR viOm/dVezncFUEKkmL2skhEF6xwgavY7MkK1zj5Tkn0VunatPWtK9MXVJ4FWPNWgkP3t y59nMbm+O6vXBucD5u6XIq/B5XDFKlYPJTTzlQL1mpifS/csNeHvl1yv1gv4XRetstN+ OH7qePbBMOuV+yuSIIOzWxcPZvGbgO4dhHhg3FSP0T9K8xHjwzUBieM/0EkVLXBVAHT9 ecy8QcD+VRvabjl2ZU9wsj4ZdX3vfOQLEqPpOQbg8ZSqcgj9Po2BSuyTP80+cChQcKbi hK4A== X-Gm-Message-State: AOJu0Ywfek9kRqE+PnKqDep1kH52GfFlDhpUOSRe5asj56OPUtk6Duj8 V6v+BCxXGldjo2kZ6wTTN6rM6A== X-Received: by 2002:a05:651c:327:b0:2c5:15a5:826a with SMTP id b7-20020a05651c032700b002c515a5826amr8672532ljp.19.1698746036880; Tue, 31 Oct 2023 02:53:56 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id ha15-20020a05600c860f00b004053a6b8c41sm1225323wmb.12.2023.10.31.02.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 02:53:56 -0700 (PDT) Date: Tue, 31 Oct 2023 12:53:52 +0300 From: Dan Carpenter To: Robert Richter Cc: Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Terry Bowman , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] cxl/hdm: Fix && vs || bug Message-ID: <60028378-d3d5-4d6d-90fd-f915f061e731@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 04:16:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781268689157682400 X-GMAIL-MSGID: 1781269528773536911 If "info" is NULL then this code will crash. || was intended instead of &&. Fixes: 8ce520fdea24 ("cxl/hdm: Use stored Component Register mappings to map HDM decoder capability") Signed-off-by: Dan Carpenter --- drivers/cxl/core/hdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index bc8ad4a8afca..af17da8230d5 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -146,7 +146,7 @@ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port, /* Memory devices can configure device HDM using DVSEC range regs. */ if (reg_map->resource == CXL_RESOURCE_NONE) { - if (!info && !info->mem_enabled) { + if (!info || !info->mem_enabled) { dev_err(dev, "No component registers mapped\n"); return ERR_PTR(-ENXIO); }