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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 366B4C433DF for ; Mon, 6 Jul 2020 15:27:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 110072073E for ; Mon, 6 Jul 2020 15:27:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729322AbgGFP07 (ORCPT ); Mon, 6 Jul 2020 11:26:59 -0400 Received: from mga07.intel.com ([134.134.136.100]:39112 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbgGFP07 (ORCPT ); Mon, 6 Jul 2020 11:26:59 -0400 IronPort-SDR: NI636LsW9wqT4bnbA+cm06WsrU/lh64oVsOh90a4yOPKJU3o5w/vycIhEp5qjHxSp9IPU6cahi pwLj+zOY1BwQ== X-IronPort-AV: E=McAfee;i="6000,8403,9673"; a="212414623" X-IronPort-AV: E=Sophos;i="5.75,320,1589266800"; d="scan'208";a="212414623" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 08:26:58 -0700 IronPort-SDR: /MBlYwj7/KgsJ9GrR/HehGosJoIuy94JitZkdzzLkYSofAon+UUD7x6feL/RPc2NlLvf6isrKu +DBHskJ4Ozag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,320,1589266800"; d="scan'208";a="313993583" Received: from djiang5-mobl1.amr.corp.intel.com (HELO [10.212.168.148]) ([10.212.168.148]) by orsmga008.jf.intel.com with ESMTP; 06 Jul 2020 08:26:57 -0700 Subject: Re: [qemu] boot failed: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 To: Arnd Bergmann Cc: Naresh Kamboju , linux-serial@vger.kernel.org, open list , Vinod Koul , Jiri Slaby , linux-arm-msm , linux-tegra , jirislaby@kernel.org, Greg Kroah-Hartman , Andy Gross , Bjorn Andersson , ldewangan@nvidia.com, Thierry Reding , Jon Hunter , Qian Cai , lkft-triage@lists.linaro.org References: <51d6e5bb-3de1-36dc-15a4-c341b23ca8cd@intel.com> From: Dave Jiang Message-ID: Date: Mon, 6 Jul 2020 08:26:56 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On 7/6/2020 8:24 AM, Arnd Bergmann wrote: > On Mon, Jul 6, 2020 at 5:01 PM Dave Jiang wrote: >> On 7/6/2020 5:53 AM, Arnd Bergmann wrote: >>> On Mon, Jul 6, 2020 at 1:03 PM Naresh Kamboju wrote: >> >> Arnd, >> I'm looking at the pl001_dma_probe(), I think we could make it more robust if it >> uses IS_ERR_OR_NULL(chan) instead of IS_ERR(). Should I send a patch for it? I >> suppose looking at the comment header for dma_request_chan() it does say return >> chan ptr or error ptr. Sorry I missed that. > > No. IS_ERR_OR_NULL() is almost always a mistake. A function should either > return NULL on error, or it should return an error code, but should not be > able to return either. Fair enough. > > Have you checked all the other 'return NULL' statements in your patch to > ensure that they never return error pointers? Yeah I looked over the rest of them. The ones that are returning NULL as far as I can tell are expected to return NULL. > > Arnd >