Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp84224iol; Wed, 8 Jun 2022 22:40:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI7TtdEXMbH2VWwjVBtBxS5r7bqB2p/rUd5HanZNIxkn/vMu96wjpBRhu3ykhHt0K4uJf4 X-Received: by 2002:a05:6a00:1941:b0:50d:807d:530b with SMTP id s1-20020a056a00194100b0050d807d530bmr38363376pfk.17.1654753257915; Wed, 08 Jun 2022 22:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654753257; cv=none; d=google.com; s=arc-20160816; b=cjwetjhkZu7rs6M7ABdWHUSC68PzPDhF4rMKtqdgXthL1AZRl3p/KtpuuDtNWbQ/JC yO1Lr7e+RZ4Z5iu9HBTEuE5Uqyt4h9GbpM/nn3IpYEbeUrO7S+zug2wUkmWvbz7Eps2Q FCcc9D7TjrBIsdIY0tJ0cA95e3/QC/gK8te+NyzGK/R1NZ+cfVJmLB7gZw6cXJNfhfqT n8DVj3eqxqM32hrKUCLydlOTcYr11Bpur3jvpatTMTDEfCB5sVe5cmXLg4I2u9XMuLeJ JW0CiiUvqbJvt12BhVZly7aQJY9hDBZ4FG1ef0qEBtINBS9qwG/4lnHi5y1GIHEsylV2 XDig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6+c0CCqzyZf84V4VMYvjSyALNCX0mdfGatwA5QHzSvw=; b=hBNTT2AxXh1OphsiPMpgb+AHj3S7pSkHNXLtIM5wOmWjEiwsHBCmK4xXeph8KXQPJ6 Sf2ZCPwbOr5A9QTmmin4UyLZjPFf3uAHJ1fWhTC2rMkZ7Dk2pC/t1zzWHLTfdyqclix2 2xYHZYCT+8FAaFeY/jBz7oXx1EZQA7tAv4VHk2oa6nbCfXgF09sD52jmaJzFOspcHl7C VFWaKtIx6QgtT5D42sb6kXnN1BDa71sF9bTokiAzgosf0nD9rRRfADlp5MbtP/Q/Dj5m 9Twum4lQYAvpwv1TlKWeX4TNBysdSQyrS+qPd7nlBhvlnIwocqlNzlje1JbYWp17EwTT 5M9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cwNlJJ5W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 16-20020a631550000000b003fb92ed82b8si31886807pgv.875.2022.06.08.22.40.45; Wed, 08 Jun 2022 22:40:57 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cwNlJJ5W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238080AbiFIFJK (ORCPT + 99 others); Thu, 9 Jun 2022 01:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236935AbiFIFJI (ORCPT ); Thu, 9 Jun 2022 01:09:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD6D186DC for ; Wed, 8 Jun 2022 22:09:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7D10361D15 for ; Thu, 9 Jun 2022 05:09:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 014C6C34114; Thu, 9 Jun 2022 05:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654751346; bh=VmI5ZpIXTp9MnI4+dGgRn5ZVS3Q0GQ1DEje/j6+uJX4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cwNlJJ5WUsHih6dgYXLhQXO23e4U3qFvVp2rbyul3rs+YOUxXaPBqo6VnACVfy6eA jybfoLpJPFZnDSkVR972d8G53Gzh4CzQytrv2Ye8dESTCM9XLLVOZRc+c1u9Jp4PlS QNZj0N3FhI2zd0yqqXLaffNCRlXvnBBBOt4oKgvB+GeYFt0+zQk6wIji7w+KgnZ/EA ob+Tb/5GWg47EQBfvN5OkV4ipsdHpgkTQsTYd50mq0cYPpLnymkZGEJfd8YhxzS94a thL/EH7M4arphzsfOM+Wj1RUotLgwcG+2tmXz1i9v/EUe+byEr9h+cg/iZQKhlO/cZ BrEWecLF+/1iw== Date: Thu, 9 Jun 2022 05:09:03 +0000 From: Tzung-Bi Shih To: Guenter Roeck Cc: Benson Leung , Guenter Roeck , "open list:CHROME HARDWARE PLATFORM SUPPORT" , linux-kernel Subject: Re: [PATCH v3 13/23] platform/chrome: cros_ec: don't allocate `din` and `dout` in cros_ec_register() Message-ID: References: <20220608110734.2928245-1-tzungbi@kernel.org> <20220608110734.2928245-14-tzungbi@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 On Wed, Jun 08, 2022 at 09:15:56AM -0700, Guenter Roeck wrote: > On Wed, Jun 8, 2022 at 4:08 AM Tzung-Bi Shih wrote: > > > > Don't allocate `din` and `dout` in cros_ec_register() as they will be > > allocated soon in cros_ec_query_all(). Pardon me, I should test them earlier. I misunderstood. The patch will cause kernel crash (NULL dereference) because cros_ec_query_all() relies on `din` and `dout` for getting protocol info and then it reallocates the buffers according to the info later. I think we should just leave them as they are. Will drop this patch and next patch ([v3,14/23] platform/chrome: don't use devm variants for `din` and `dout`).