Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1057626ybm; Tue, 21 May 2019 08:03:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLl1GEUQNkmgl3LFFGC0mAPQUwp+qDEzL5TIQD18Kce4E+8SAWxdJ50zliMaJWHVOCEtYv X-Received: by 2002:a17:902:a605:: with SMTP id u5mr34148031plq.43.1558450985528; Tue, 21 May 2019 08:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558450985; cv=none; d=google.com; s=arc-20160816; b=hFYFSSj5GrQz2XRpmYoJua4+7rYuCgvUjzpKeFgS20+xxzUe7cYE0QgUO0wEnYG/yx pRCe0ZAdWd3P7NayKscR5hMOvqZxYphEFPNfg4rjhe1QnbX8NCh0ox+hsil340BgVaMo 4RyHQDbqGE5oyaQiNel90fly6DqNdTs9I8/GxN6whK/KrAniPBJf7Z0NAV/0r+6DMqyC 26lwv/kDdwKdCICaCcvYAL/lTerraNFgggjdx5UJ3a36gDZnV4rC5EBdFsXHXDKv/4Nx oiqAzM2793e6gP329fzw2Ppj+DnlG4QyPtS8g8a22MP8CxSpcWTI8FrhGCx8Twfxx7m9 g4zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=B164xY76PAaJHCklCGNK3/SigqrJDxrGxeTBSbiHos0=; b=Gf3qiX2cNr7wBGsXGsAsNQBtB7u21Sm40UYSn4QxXhMVCRMi4RdNwKq6tJhIvSVkC/ SPDNUd6lJixa2oTP9HThHJCr/Kc0QvxGoDqIhSRJ3h3SkbgPnfkta7z04saWHHqmjUoV 3TVNkXkrt2gDwQ1GU/ELvNRzV2cIfMDTK3tTQoBi2SCjYCiDMmj9DhsdQ/d5CuL8ShrV ptDwNZJnOcn5EtdYPz417OecOghQxXAmLu7ojx/NnGXcKlEn25qU6Sq21XHAj8peN1da 4u9uIEA0yKGRNU1E7LLFttVdISID67WRuU5KOK9AOSW6xHLQdwGfhhkLqwRq1gH31lpA L3RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uP7vqaIw; 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 r5si23487915pfg.152.2019.05.21.08.02.48; Tue, 21 May 2019 08:03:05 -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=uP7vqaIw; 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 S1728741AbfEUPAh (ORCPT + 99 others); Tue, 21 May 2019 11:00:37 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35816 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727969AbfEUPAh (ORCPT ); Tue, 21 May 2019 11:00:37 -0400 Received: by mail-pl1-f195.google.com with SMTP id p1so3198475plo.2; Tue, 21 May 2019 08:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=B164xY76PAaJHCklCGNK3/SigqrJDxrGxeTBSbiHos0=; b=uP7vqaIw/npd7e9gEqOrinrFsec9BTKODKGoZw61tOTGtHv4J/zw6OoVoXR0SviAZV +LZcJE/hbKYJEDNrozCL4FmpeB3jfQy4sMvHqtD/VBY0isLxcZutvrJciXzHq2B7NtSX 3CL7Q7mhAvwk60CRUIyminErcMpt3cLicPyVhcmNvL8VwXbfVloRGGGDrO5Dp9dKPtqC WcPVWVpQssCutPdW/q0Niz+F30qJ37fCwwG8Mh078qzf5RsqBm/HMzytuxuO51eqim1l 2BbOXujOAUngh7QWZ7znHGq5ubIJQMYn4qE+B8Ar3YCHAM1GlFQvl6lemCCUr3gdabKH e1MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B164xY76PAaJHCklCGNK3/SigqrJDxrGxeTBSbiHos0=; b=jlHqNkMGrC+wQK7nskgtHlOvGbU24Re4/kqS61he3AB/wKlrWHgYHZaa9BAGU0DYd3 7A51MAHl9VincCOily8CBB9I6xdphXL3gcXFFBn/Q44z6uWR6kj6452SAXETHPSkXVRA gQfN/cVd4rOtFHVE8m9HlbSTJTJLOEGaH0qe6FYAPSuy2NNJZyLBkGiTSNxjmxEt+4PW /G1SHt28QwCDbALOs5REvEdJZhjySM6MTY8CLosQ6ThOfv52lxUr0HOc5aNlKcmcRPUR MaczXmP8cL8iYAdoacxSbop0QQUlsO/a+efNFqObLOAUhyPnArjp4Dl5sq8KF90YFbkp 4cqA== X-Gm-Message-State: APjAAAUR3caEVKMcHlPe8iq3NTYXWrFIPjzT8sXII9mVo6Uh542blIAp MN85qfDotZheOHcF7YfHyb3PP7yU X-Received: by 2002:a17:902:294a:: with SMTP id g68mr58170042plb.169.1558450836681; Tue, 21 May 2019 08:00:36 -0700 (PDT) Received: from aw-bldr-10.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id v2sm19953381pgr.2.2019.05.21.08.00.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 08:00:36 -0700 (PDT) From: Jeffrey Hugo To: robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jeffrey Hugo Subject: [PATCH RESEND] drm/msm/mdp5: Fix mdp5_cfg_init error return Date: Tue, 21 May 2019 08:00:30 -0700 Message-Id: <20190521150030.13609-1-jeffrey.l.hugo@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) Signed-off-by: Jeffrey Hugo Reviewed-by: Bjorn Andersson --- 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