Message ID | 20190309042450.4188-1-kjlu@umn.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33550139A for <patchwork-dri-devel@patchwork.kernel.org>; Sat, 9 Mar 2019 09:38:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2137F2DB11 for <patchwork-dri-devel@patchwork.kernel.org>; Sat, 9 Mar 2019 09:38:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 151A92E6E4; Sat, 9 Mar 2019 09:38:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BCDBC2DB11 for <patchwork-dri-devel@patchwork.kernel.org>; Sat, 9 Mar 2019 09:38:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D01A389A67; Sat, 9 Mar 2019 09:38:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mta-p5.oit.umn.edu (mta-p5.oit.umn.edu [134.84.196.205]) by gabe.freedesktop.org (Postfix) with ESMTPS id A0ACC6E348 for <dri-devel@lists.freedesktop.org>; Sat, 9 Mar 2019 04:32:04 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-p5.oit.umn.edu (Postfix) with ESMTP id 18712CDE for <dri-devel@lists.freedesktop.org>; Sat, 9 Mar 2019 04:24:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p5.oit.umn.edu ([127.0.0.1]) by localhost (mta-p5.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rzp6EvshXTbq for <dri-devel@lists.freedesktop.org>; Fri, 8 Mar 2019 22:24:56 -0600 (CST) Received: from mail-it1-f197.google.com (mail-it1-f197.google.com [209.85.166.197]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p5.oit.umn.edu (Postfix) with ESMTPS id D6551BB4 for <dri-devel@lists.freedesktop.org>; Fri, 8 Mar 2019 22:24:56 -0600 (CST) Received: by mail-it1-f197.google.com with SMTP id 127so13812775itk.5 for <dri-devel@lists.freedesktop.org>; Fri, 08 Mar 2019 20:24:56 -0800 (PST) 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=ehEIpCPacJfov5ndAxPWAlvAbToRoZroygpBuzor558=; b=MK0gf3ww11KvLCiB9pJszdD2+e3vhSIUiSKF5WP2PNNQ9EngG4eLrCb4qCibuuBeI4 DNAOfZ5R2AnL0yJRMSmlhWCb3o+Mcm7MfIW+bSNzrBN9qjEuPkRGv152Zf8GxgwbvwRa +hov8VCXSqFYYB5Qj54dv2hajJ3/gwYcxi14c2zsbZM9UyYssnMM9pBj8FPWYvZYfIk/ 2YkYl84YbkUJ5wIYyCMdLHZ7MR/fk1BBu9KGcBhlgA7EPrwXfyo6R/c6IG/ZFIOI1zjP xKVyxn+Cmvy/mBHSKQ04YiYNBuZ2uVNx2zh+9Gi+eah/S99SjcLypmmK3M+mRGmFqIiM oPZQ== X-Gm-Message-State: APjAAAVDNrNeCvDtS3ELvAaGtyuz3yNab8620iwbKxoEcLAyDpYH5jyc FKpXPtKLKQbRNqNwDPt8blUj7EAAAwlE6QwrUPimY0nKmksimPdMtPYNa+OJ61nDGnz5KskbaHq v87k1nLVEU1BynBqu+SAY4XbKd6mGRXbt X-Received: by 2002:a6b:e608:: with SMTP id g8mr12060592ioh.188.1552105496543; Fri, 08 Mar 2019 20:24:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyD2wPkM4tveOpnEy6CUMu08svaGx3WPCoER8ruyDZ0iynDLF54UG5St7YOlrmdw9xhEu4Q2w== X-Received: by 2002:a6b:e608:: with SMTP id g8mr12060589ioh.188.1552105496308; Fri, 08 Mar 2019 20:24:56 -0800 (PST) Received: from bee.dtc.umn.edu (cs-bee-u.cs.umn.edu. [128.101.106.63]) by smtp.gmail.com with ESMTPSA id d6sm3787611ioc.44.2019.03.08.20.24.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 20:24:55 -0800 (PST) From: Kangjie Lu <kjlu@umn.edu> To: kjlu@umn.edu Subject: [PATCH] gpu: i915: fix a missing check of get_free_page Date: Fri, 8 Mar 2019 22:24:50 -0600 Message-Id: <20190309042450.4188-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Sat, 09 Mar 2019 09:38:30 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=ehEIpCPacJfov5ndAxPWAlvAbToRoZroygpBuzor558=; b=CxSzSgs9jJfGJLfvwVeGWiIJfj35n0az4WvIO8EavcRaGuEDMPGfkp1DRBKnb1hdt4 IxJyRHcc8o9EOlN7eEpkQRFTKHSjHJ2pfCzq+iEnn4LdLG2JA4DDQPMnxRY4YgR5wDWj mvopNWLD5GmNcMtmN6tc8g0T+x0z1D61hFWU9uMm7QBXFXfQYXbRn37pmlgNeWQiQuZN 2u+isAILk2hnoKFGH4I5YRNRfeRGFK5BQGQKlRbXTHJZO9LiKY71Q323oXEir+bP85JT S2LNROhwD+n1uqhTa68yCYLrwPnz4DUcDPYej31fCMubcFnXJQzsrRnf5lv0/3YIhVuW bXgw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: David Airlie <airlied@linux.ie>, intel-gfx@lists.freedesktop.org, pakki001@umn.edu, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
gpu: i915: fix a missing check of get_free_page
|
expand
|
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 9a65341fec09..ad54fc3551df 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -227,8 +227,11 @@ static bool compress_init(struct compress *c) } c->tmp = NULL; - if (i915_has_memcpy_from_wc()) + if (i915_has_memcpy_from_wc()) { c->tmp = (void *)__get_free_page(GFP_ATOMIC | __GFP_NOWARN); + if (!c->tmp) + return false; + } return true; }
If the allocation fails, return false to avoid potential NULL pointer dereference Signed-off-by: Kangjie Lu <kjlu@umn.edu> --- drivers/gpu/drm/i915/i915_gpu_error.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)