Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4210538yba; Sun, 12 May 2019 07:32:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx75IrqmEK3NL/um+iNKqIy1/slo5+kW48LVJZFIP4k3INwbPReZM0XwA647ah+UGMSLRME X-Received: by 2002:a63:5020:: with SMTP id e32mr25235239pgb.215.1557671538938; Sun, 12 May 2019 07:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557671538; cv=none; d=google.com; s=arc-20160816; b=KsR08K5Gw43plVg0uS1fPLmlScovhI6Ex+Mx8IxHE0qx1mwYEfNm50vJOrsKhZBRmV UqBRiDaXXTBX6cNXoIE1YcY97rkx3iDnaQRXeAca0Tx5udjO9x/O+z1T7LuEruMWGLip 01Ht+5V1PNvB5x1+QSfdM1u4YPaymJ3R72iZPRFV9VfaNG/CaXCR/BAOh+bH1xQG5WFv MkENiEbMoSTXbor4nuZMUluS757+qh4moXA/IWdx5O1gJRQ0WB/hfKGqIS7iWkyiuTGY LBWnKc4yDxIVQwhg782gUfW1ZKbmqgvWnCPlmgE8Sk4FcVJi4kYFI5IcjqqRr3e3NvKI hT7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8MmPir51Pep1QquiMlNrOGRX1Y2TZtpKY9viaAkjkQI=; b=mITbAuKv1p7L615Fb59aPDLInaQaj+SwKi0DgZHvvFKZAQ9redeWL0yEiJS2MaWL3s w6JJFwm0pB464+fMLWEL0PNNrRYMRYhnSVFNAvfidhrTkERN3+QjVe9bQh/WWKULJmvt 3FgPJmCjJaQ9dYx63VVUV95BJDxzkDFznFDObnjy5vUhoWtQaZ1x+/MDtwMq72f3odCV r0Y/7+e7HStmf1mr5Gm+gZkiYjmRTwiaKtq9jZ0fl73yl2M+VH8OksN6YPiu1vBMX0Tp P+5C1FtcPyvftkQR1kudIkptB0N+e1XkU5gt4n++qGEZovbnnil7e7mbzQ2dYk6WyXv7 9FYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rhWhYEal; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si13542298ply.226.2019.05.12.07.32.01; Sun, 12 May 2019 07:32: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=pass header.i=@gmail.com header.s=20161025 header.b=rhWhYEal; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbfELObD (ORCPT + 99 others); Sun, 12 May 2019 10:31:03 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33409 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbfELObC (ORCPT ); Sun, 12 May 2019 10:31:02 -0400 Received: by mail-pl1-f193.google.com with SMTP id y3so5105359plp.0; Sun, 12 May 2019 07:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8MmPir51Pep1QquiMlNrOGRX1Y2TZtpKY9viaAkjkQI=; b=rhWhYEal8pAMHfedEvpe/VBQbVlKLqFtXxiQi/XHXYuwxAEt9D0juekW4ZFobDtJXQ 44oh2TGhUvx6yE/t+ilpT/WGKb0/DTK+h2WOhXvxp8TTaIkkeW+cKK4y7p+dSW7tmY5o ktiEfu0TC5Ll2KqXN1KEHgdtYaIzNAohjSs5RsxOiKeOjZjnust9Vn9J3p1V2q5GVsvD vJM2pOAkNyUS7obCx76y1hN6YownFya1JANnazvaCz/y3t2hlyUv3z8uSoCOxwFr1Inr f3Ef8OXBgVB+ArWaaaLwqXAjynxcN7FgSAr9r8xloN1WhGyu/+2QxvCUMkRMghxMcpoY kuvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8MmPir51Pep1QquiMlNrOGRX1Y2TZtpKY9viaAkjkQI=; b=GFlx3vGsWuytvd7/rw05rhhrYXzmRFn669qUi56o2/ZRP3XhH9SBTiOTfQrQmuIdzA aWq/omnV31/pM5rEo950F8mkmcFjPxC4n2gEmVF3SIckpe4q2qHzEazUs9lRhgKK8Yfo E2Vv2++F/58CswYIlIRGEgpWhHPcxgmrV0eJXnGRj5xZ4tS1HA9IkkWuukaseINxiLGd U+/5v/ZlFyru4+Xo68ChdNUETw28+MlVEiEtRMlwMWeGAXO1KGb6VIsWC9PQard0OXX4 NkrYLfxjDUInzT5X4cYFRcKBPo6ymtOxBsErL9/gRiUdEnb06HHLlxLY/EJNb29lmjsd sJ0Q== X-Gm-Message-State: APjAAAU/uiXkwXLa9nntENCncNRerlLOAT83FrttqIrsn3mpD3UHbeBg 5dbfDP36S467I6BhCZW+Xx4= X-Received: by 2002:a17:902:7594:: with SMTP id j20mr25677961pll.78.1557671461643; Sun, 12 May 2019 07:31:01 -0700 (PDT) Received: from localhost ([123.213.206.190]) by smtp.gmail.com with ESMTPSA id z187sm15546976pfb.132.2019.05.12.07.31.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 May 2019 07:31:00 -0700 (PDT) Date: Sun, 12 May 2019 23:30:58 +0900 From: Minwoo Im To: Chaitanya Kulkarni Cc: Keith Busch , Christoph Hellwig , Sagi Grimberg , "linux-nvme@lists.infradead.org" , Kai Heng Feng , Mario Limonciello , lkml , Rafael Wysocki , linux-pm , "hange-folder>?" Subject: Re: [PATCH] nvme/pci: Use host managed power state for suspend Message-ID: <20190512143056.GA7761@minwooim-desktop> References: <20190510212937.11661-1-keith.busch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (ed9d7727) (2018-07-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + union nvme_result res; > > + int ret; > > + > > + if (!result) > > + return -EINVAL; > > + > > + memset(&c, 0, sizeof(c)); > > + c.features.opcode = nvme_admin_get_features; > > + c.features.fid = cpu_to_le32(NVME_FEAT_POWER_MGMT); > > + > > + ret = __nvme_submit_sync_cmd(ctrl->admin_q, &c, &res, > > + NULL, 0, 0, NVME_QID_ANY, 0, 0, false); > > + if (ret >= 0) > > + *result = le32_to_cpu(res.u32); > May be add a check for result here in above if before deref pointer :- > if (ret >= 0 && result) > 'result' already has been checked in a few lines above.