Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6317155yba; Wed, 1 May 2019 09:52:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgV827eOPkQncHrqNbJ3ZOU0X+sx0Gu/7gqTg+tK8BZbvse4E3seIIQC/IF2weXmdoPqIt X-Received: by 2002:a17:902:720a:: with SMTP id ba10mr25070380plb.192.1556729579350; Wed, 01 May 2019 09:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556729579; cv=none; d=google.com; s=arc-20160816; b=mTZ2BK2i6tdhnHSTHW8/iFwBWzBbg1wjSYT11dYoNjwyFYjHF1cc74vyqPc2TpWMDH F0es9B7ddrPEhCh7WJEosNp6s93xwnzj4FaRL59vBSv3MjlqpW/2PsaNs6aPRdP+GrkL qbARjDQy7HQwNWgq6kk2SuqOwrqt3HuLhdMDASAer3XK3Ofk9V5UP28tJgh6dNL7RbVf Azu2XycrJ6FQ4/lC6CnIULKerTs/Jnv/JOrGkwPNQqFz3w/FOor7mur7taOFQo2Oqk1q NS1h/Ikub/nBB0AbinXweMikL9Hm2cPf4IACv9cioSQCkbgnxNBuep32h/3kRVA1ZiNv ixgg== 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=Kd5MuO+17SSO78jER84yawU/+kS4c+qH+M/4Z95iLNY=; b=H56NVfY81ZTM6RAlIgzCg59I31J6aBEShrUs62enqTmJV/RAWEqFLLVZMWZvNmu4MZ 2fJEulGbP0dqEuhCzmbvdU0UyxT4GJeKBSCvSWBipjSSK3sD4L9RefNH3aSlKMo74d15 +vHyFxZlGiDNdAXIf/IxpnJdU0yf8CAuE1qMVE7y9dPP5iIE3Mcbss8J/LDExlIY11Si 2Q7nocHa+mr/JbdSzOD/d4hVyei/r3ezodwwpGATo7LPuzFU2paFgqodJmC+tOtCSxID NOwNdJxJRpiKGHd2LkkWbOwzFfTDjuoDDKEpZnFrS1TKrq8Qr96cqx9fkoaCkdjmbsDV tWwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p4961rDh; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si24337652pll.254.2019.05.01.09.52.43; Wed, 01 May 2019 09:52:59 -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=@linaro.org header.s=google header.b=p4961rDh; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbfEAQvQ (ORCPT + 99 others); Wed, 1 May 2019 12:51:16 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45538 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbfEAQvP (ORCPT ); Wed, 1 May 2019 12:51:15 -0400 Received: by mail-pf1-f195.google.com with SMTP id e24so8839221pfi.12 for ; Wed, 01 May 2019 09:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Kd5MuO+17SSO78jER84yawU/+kS4c+qH+M/4Z95iLNY=; b=p4961rDhAAkYdVL2MmCqcSFfDmoIe5vhA3cShJh7egp3Eb4kLmL2sB5jcTZBT1bBrs X2UUpPkwn29f2c9UAdFVjJrMkV/aK/zL0MDk5lw3aYKNt8+QE8TalXcEbVeApDAU7UpH c/g+s2N/Ee/n2VFwIgnhu9W8R9Ope8RnBjoUlC04/UVVNRV/DsvA60nM2TVkJcPgPPBn 0NuLBjuj6N2yXocjsMpPtUk0uZ2h6lEVZZCL6NhHgemzzc6Y0KboxPCTpXRsyjpqwnkO 9Fb6NIX/Wne6nx8wc6NGWcfcJ8cX/arFAHndFz2zwEoeHM97MNQ6pXGTfWQ6ddBRLQBq 9foA== 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=Kd5MuO+17SSO78jER84yawU/+kS4c+qH+M/4Z95iLNY=; b=ZJDGVuFwCVoahBJf6CqXXMReaq4mbkO3lbPJ4N+yVDcbCITuOLeqOp9CGabHb4U817 +XyijEj0VPOqCDMpcvA0WbvT9eKJ3scS/0QeN/6mMHtiTaEs+2dLNkznlulFQITeOmmF NlBgqgnsQAQJb02XTmC/3bcOOqaWcZZtSh3hNtEJnOB6O422j3MhEuamm38o/0OUIJC+ 0PJDUSRzGyBF5mYwQkgKUvJc2II03LyHdXBJqWX4+oQ6lhrAsKxOJgYZl/fA9XnHCZ0g EZmni+7jCcWsL7GhF21IEh0RSQUTSjzlfuxwHZPb/dvEcTFFN+IA4TU59/AhflYEY/xd +T7g== X-Gm-Message-State: APjAAAUebZ5r5+wZswhfaJLxCx/PJw3VwF9MwmszakorCt9QtaKVTM1R JRhl38qtySWruu93OTxncDtOqw== X-Received: by 2002:a65:6145:: with SMTP id o5mr17411677pgv.262.1556729474737; Wed, 01 May 2019 09:51:14 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id 18sm58777799pfp.18.2019.05.01.09.51.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 May 2019 09:51:13 -0700 (PDT) Date: Wed, 1 May 2019 09:51:15 -0700 From: Bjorn Andersson To: Jeffrey Hugo Cc: robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/msm/mdp5: Fix mdp5_cfg_init error return Message-ID: <20190501165115.GH2938@tuxbook-pro> References: <20190501161437.15728-1-jeffrey.l.hugo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190501161437.15728-1-jeffrey.l.hugo@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 01 May 09:14 PDT 2019, Jeffrey Hugo wrote: > If mdp5_cfg_init fails because of an unknown major version, a null pointer > dereference occurs. This is because the caller of init expects error > pointers, but init returns NULL on error. Fix this by returning the > expected values on error. > > Fixes: 2e362e1772b8 (drm/msm/mdp5: introduce mdp5_cfg module) Reviewed-by: Bjorn Andersson > Signed-off-by: Jeffrey Hugo > --- > drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c > index ea8f7d7daf7f..52e23780fce1 100644 > --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c > +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c > @@ -721,7 +721,7 @@ struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms, > if (cfg_handler) > mdp5_cfg_destroy(cfg_handler); > > - return NULL; > + return ERR_PTR(ret); > } > > static struct mdp5_cfg_platform *mdp5_get_config(struct platform_device *dev) > -- > 2.17.1 >