Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1730775rwl; Sun, 26 Mar 2023 08:07:50 -0700 (PDT) X-Google-Smtp-Source: AKy350ayHWSYd2LZAMsGqgX1wRY6DLtbx7wSrDNYSqTnkhE+1ZnUOsLvUgyWQwY6WZcWDIPQVdLF X-Received: by 2002:a17:907:6d9c:b0:8b1:3483:e3d5 with SMTP id sb28-20020a1709076d9c00b008b13483e3d5mr12700530ejc.48.1679843269900; Sun, 26 Mar 2023 08:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679843269; cv=none; d=google.com; s=arc-20160816; b=YE43bT55AVeMM4mwdqLitaH/+/JSA3qodSbZerIJq3aXrqW3jwC275Q0oO4J1Ftrcq Ag9TG0lr2AJZdFc2y5Mnc1UIIyPzTWqgSu9A1a3Mc8HsOZb3zUXmrVNgat59PCP7oLQP gFq3wiITWBtJPFxI2mIPCSZTmvaMfnNl9KH3rEBgkSr1kVmqG9LDunemyU7CiQ1SCJdn oYOIu5NWI9SxbM0GDwWmSNTLt96fHPpreKSqxPIXUqN5cxtmdOK7zbEDHms8n7UFte8s 4aJQX/SL9EdzjB5DVudhexdittQweumRvmJtxJ4eJBKpn4Fn4nJv9z0TnqHJlu4RPjLV Lvsg== 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=GQv2uoFLvvxVaaD6ZW3ZlvEbWNNIX5j5kDsTpL0/9tc=; b=IKpuSPMDktJed5Ra3aG/P4koPsakw0PSxWjnBOEDPkp1wUZafYGGWka7x5M8WqQnKi qwPAbbYjubzuqK0Yiw6sVwEeztIVMRHfxbKj6J+0piP19LwWDodhhu0QorTnlpYJLr/0 soMk3LJdm4IUQvWZAWM3zpS6Nyhjszr5JZBonQU3BGKU2IhIZC8GMuik+5UdZNJDfTQI DlGAgdZmYDFJ2RCD5w0LeqcQN3axfAHNZ3HWm23C3RialYkqKrAMeSMdPB5SvzoiLdlI 4XeejAySesaxfm+8qyd6UTzewX+BBKs2Br6MpL2cGmogMcUhDuorVSnOx24I0p+LK9xk nKIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SbLh6N52; 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 dx26-20020a170906a85a00b009205fe06a7dsi25122623ejb.576.2023.03.26.08.07.24; Sun, 26 Mar 2023 08:07:49 -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=SbLh6N52; 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 S232191AbjCZPCe (ORCPT + 99 others); Sun, 26 Mar 2023 11:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjCZPCc (ORCPT ); Sun, 26 Mar 2023 11:02:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDAE3213F; Sun, 26 Mar 2023 08:02:31 -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 ams.source.kernel.org (Postfix) with ESMTPS id 63BDBB80CA7; Sun, 26 Mar 2023 15:02:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E9C1C433EF; Sun, 26 Mar 2023 15:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679842949; bh=dAwvdcQMLX/kWoENcNEUlS6j4GfV4F+aixjK1o/KG2c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SbLh6N52ir1TPrCLXQAX49pYULRuQwiAduLhNvemmudEBnqU8dTkmn6UNeYMiGiTj 37TA0apD+tYxDxiL6JJwvLQANkmLoGNEDDhbiPWTcqEEayUsLl/ulWg0ee4o2GF2LF 6UYPEXLfQJpbtFOsSMfQv/Y94ixQY2lR4LdLfzaizWDBYTQyfSLk4X7kJg+nU4JMTs 8QKluaXKXJH6CK8BlaeGBC6T2pw3l91NB/nDYjoyT+uQMZXTpBH/Fjnf8TOmbEc6Ie Ks2f1g2u5QK7Lzl+uV6X/P2+CLCkGu8icfz9T3Z3J2sgvl7DlsYKeRWV4ePviPzdFo 99H0AAKFvtDEQ== Date: Sun, 26 Mar 2023 17:02:25 +0200 From: Andi Shyti To: Ye Xiang Cc: Greg Kroah-Hartman , Arnd Bergmann , Matthias Kaehlcke , Lee Jones , Wolfram Sang , Tyrone Ting , Mark Brown , Linus Walleij , Bartosz Golaszewski , linux-usb@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, srinivas.pandruvada@intel.com, heikki.krogerus@linux.intel.com, andriy.shevchenko@linux.intel.com, sakari.ailus@linux.intel.com, zhifeng.wang@intel.com, wentong.wu@intel.com, lixu.zhang@intel.com Subject: Re: [PATCH v6 1/6] usb: Add support for Intel LJCA device Message-ID: <20230326150225.p5m4fxcwmhwdmtd3@intel.intel> References: <20230323172113.1231050-1-xiang.ye@intel.com> <20230323172113.1231050-2-xiang.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230323172113.1231050-2-xiang.ye@intel.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Hi Ye, > +static void ljca_read_complete(struct urb *urb) > +{ > + struct ljca_msg *header = urb->transfer_buffer; > + struct ljca_dev *dev = urb->context; > + int len = urb->actual_length; > + int ret; > + > + WARN_ON_ONCE(!dev); > + WARN_ON_ONCE(!header); WARN_* macros should be used when we can recover from that condition, while we are running straight to a NULL pointer dereference. If !dev or !header is not a warning but a "bug", so either you make sure we don't go ahead or remove the check. The rest looks fairly good, Andi