Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1629269imm; Thu, 14 Jun 2018 00:56:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ6INlH1j7iOUqLrPkEj6FSKJucCaWcqmoNE84LPu1E7NP2A1FmqlhdEG4hrIAaL3YuNxoB X-Received: by 2002:a65:450c:: with SMTP id n12-v6mr1390145pgq.242.1528962978209; Thu, 14 Jun 2018 00:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528962978; cv=none; d=google.com; s=arc-20160816; b=PpRwdXK/WYK20cBuYnEaokRa1RCQYNxbGpegqCId9mynl+f7XZpwI0tSIWfmFyuyLN HKSEE+WR+ZrgIWUifRVYSQiUsBHYn3a3irvroXE/R7Xv76I1i0MHANMOCoAc5Ln+eqL4 qjwQJaS1wBU4IyR79y1QlSAOVWsHcz8QaMKFpiu5nOBQp/PEH3BOwz4MYLPwZhlskOs/ biXWEgFQYoM0Yb0P4KMiKwZVtcrf/2naBATyjw4xChtaSewtyJE9bnlA13BN/JNINaF+ XTWeg+YYiNI2WAa+Vnu+sTD2LbfIOX4RdEwQ2jebl10bZJFqX5owTZgdjO79B9cvgWFn RCOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=nlRuXHHZqkXniZqE+zv+GcoV2JyN5tBaS+Bo2VVMAa8=; b=AYENzqGcACVrONvFiUirG8FAJ4eHsP1ttDOTWw8vY7LQ99g7vGcYF8JBN5H8bFdhXm 5m8D/6BcTbrP4mS/iTGqUKE3miN9zQZv+FGdey7W5R94WZ9IbwZxCqrJ3WzxtQdNgQ2v XawY4Edh5Ih8PLHlu4fuX55wh9cZ3Qjh/ZorLLLcIeBNxuU212aspiINwRr239M87RIk ibqGA7fzakngfFvDVuvDosakfxQ44miq5CD4TWZgxLERrNrLrBHRR8cSAxzfriiyPZvM SEWNwgNXMKiggt8oDp8kRpKzpDcZzSMxFF5UVyP3qW1B0xOT7r0qLChWv6uj8aGzgHoe 6Otg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YZd0scJZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 98-v6si4770889pls.430.2018.06.14.00.56.04; Thu, 14 Jun 2018 00:56:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YZd0scJZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754703AbeFNHyp (ORCPT + 99 others); Thu, 14 Jun 2018 03:54:45 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:33817 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752933AbeFNHyl (ORCPT ); Thu, 14 Jun 2018 03:54:41 -0400 Received: by mail-oi0-f65.google.com with SMTP id i205-v6so4831121oib.1; Thu, 14 Jun 2018 00:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nlRuXHHZqkXniZqE+zv+GcoV2JyN5tBaS+Bo2VVMAa8=; b=YZd0scJZwFm8tWFGfXrFrMSm1vDbInsFJ0WbkaUzgS+QVaO6HiU72W6CYAb1WoWhr/ XM78JL87JticNiXWwM2BVp99DA7tA1SiHuNt3v+XkZx7r3HpHlvRYxgO17QhGU25wbz0 tjIEJDWa2pIr3EIBXvnfjoIjnEU3Wxe5BcMzr7pHvjAxi3dxOfoXfLNEyRVIQ1OPaBko Sz5eMgi76V/PFEG62zMOMby0CD3g9bx9JoGPJODg1QnSc9NYHV2CEK6JXHUK0mtRsT5D HlpXmOdQgQhDlYTetnfijkavwgUqlmXyz99YJZ0WN01WdapLYTSj4HImvwu8L+OuzI6W zSmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nlRuXHHZqkXniZqE+zv+GcoV2JyN5tBaS+Bo2VVMAa8=; b=XUKFGTHIGrRdTX3Dh1Rr9+HWkYO01U1cTjCnqjJhzeOjzOzHBBm57T3B1H4MBBzWGW XplWfyvMPAIGTxQ4sc/lFol+FXITraTEwz5UntX0UIsG1JcRMZH+THd9/MzIj4DDTNJz 6Yij88wwp+gAZIR+NTct3HpWq6u/a8QQyVV5Tq89Z7VbtSlAkS0+PBwZtI/0nQP3eHZn 8hZQKyXhWgaByqPZS2rWrnaMFsRZY5+LWB6jPenFPnlc9Xy7oif2cAcvr5CLIBj89S22 B0yHYfsMJ6aKpG5GWEN3KQvDoiisvmDHFp8qHOquD5zhJTGRWHOXQko5bMzHJcausTgI oOgA== X-Gm-Message-State: APt69E3vDEY2BCbqmgLQwcI/PG/HytyThpZgw10dIV51AWovJsTS/R9d XEPRFNeU3ApDiFmKJCMETF/8VHavp+S2fLSZn4U= X-Received: by 2002:aca:ac16:: with SMTP id v22-v6mr732235oie.227.1528962880717; Thu, 14 Jun 2018 00:54:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1429:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 00:54:40 -0700 (PDT) In-Reply-To: <1528778292-41332-1-git-send-email-jiazhouyang09@gmail.com> References: <1528778292-41332-1-git-send-email-jiazhouyang09@gmail.com> From: "Rafael J. Wysocki" Date: Thu, 14 Jun 2018 09:54:40 +0200 X-Google-Sender-Auth: H8CSuemiUCpyDwWQ-A_OoakqSeI Message-ID: Subject: Re: [PATCH] ACPI : dock: add error handling for acpi_bus_get_device To: Zhouyang Jia Cc: "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 6:38 AM, Zhouyang Jia wrote: > When acpi_bus_get_device fails, the lack of error-handling code may > cause unexpected results. It is perfectly predictable in this particular case: adev will be NULL and acpi_device_enumerated(adev) will return false. > This patch adds error-handling code after calling acpi_bus_get_device. Which is not necessary. Thanks, Rafael