From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 862B6C433EF for ; Thu, 9 Jun 2022 05:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbiFIFJL (ORCPT ); Thu, 9 Jun 2022 01:09:11 -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: 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`).