From patchwork Wed Jun 7 13:24:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 9771525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 05F5860350 for ; Wed, 7 Jun 2017 13:40:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC9DB27F85 for ; Wed, 7 Jun 2017 13:40:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E160D283BE; Wed, 7 Jun 2017 13:40:05 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 8142027F85 for ; Wed, 7 Jun 2017 13:40:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67F566E239; Wed, 7 Jun 2017 13:40:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0075.outbound.protection.outlook.com [104.47.34.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B0006E239 for ; Wed, 7 Jun 2017 13:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SchvWOVrKGkMX6/NoEJn8vaGHltbONQAf/+Id2Nm+HQ=; b=H58tbCy8ywBua4WHidZ5uBZv4kSrGWxik6oHA2DTcopt92mHiWbOyIozousgSIdPZgEfNmha7FRIhyFumUzV+uDKCfvT8TQ0KkAoEs3J17P+ojMETNSwidd0AsurFNQNNc71rI8TIetf+hdypcrg4t+ujDiRbmhQBUgoW/RNHQg= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=vmware.com; Received: from ubuntu.localdomain (155.4.205.56) by BLUPR05MB753.namprd05.prod.outlook.com (10.141.208.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.3; Wed, 7 Jun 2017 13:24:58 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH -fixes 3/9] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve() Date: Wed, 7 Jun 2017 15:24:19 +0200 Message-Id: <1496841865-2349-3-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496841865-2349-1-git-send-email-thellstrom@vmware.com> References: <1496841865-2349-1-git-send-email-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: BN6PR16CA0019.namprd16.prod.outlook.com (10.172.212.157) To BLUPR05MB753.namprd05.prod.outlook.com (10.141.208.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR05MB753: X-MS-Office365-Filtering-Correlation-Id: de1bfd6b-af33-4739-3204-08d4ada89837 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR05MB753; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05M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qnbNoEbGuYUmEn6O8kr50WiZc18TXLTDw8nqJf6jEozmJJXUanAPTRCpDAtyUIu4hd8aNbaN7D8gcxRRSMA==; 20:iVT3e6PvCv9Cgtr1Laer1CPt4sARYwLKJEqaHBUOm1uRGGHJdRqGchzzE9123QzmKhU2eIKh1+td2RD8M0IkAXhf9BWNZPMsLc+SJct5hJiYG0FSq9TXQhJmbtBGQnxvs32QWdEJav4/mK2DMcaTgMBGCChDyMHIoAQdKWCYzXgi9TS/2WDgPlL/h7rjqp9RAuvefE7wh1qdl/jQGy/B/x9NvEGeoE4UIEZ5ZT+ES+GPiTljk7FriTZ4s5umFdvygrRbr2/Yg3fiH9qeJlyOQ/aSuQNnX/D6j1r+OaL6f1CTWcF530/lno3A1N+N0dHcZhxwx4Lr0Am0yEHgs0uLx2kh3knDLY1DYF2MEudRW/p9442NTEy9ZKWOAx/olisJsyW2YgnLJ5n5kO1Gdb9FtGV3XGtrRNlbox5ov8iiXucnXDqcEMe3qBElAsBysTk2vnS69yuVWVBbECbFNdKDHdtakgPDuPqa/wUCLJ51m5NoiE/ORjFCdVJHINwlCsXb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(9452136761055)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB753; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB753; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05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6nn?= =?us-ascii?Q?X1olGDJyXfSb8CTRAg9yU5iduxxP1e7gojQHZE9yyviv99YPAxVNj7yxWgO+?= =?us-ascii?Q?BdpfTY0/WAsg957w/hjB6hb7Tr6SQv605pHt4jGVLSZb/pF0ZvZrQAZ2Rt1c?= =?us-ascii?Q?vGeMNfXy6RJdfMyQPkYGIHNm6AH8iby9dHWhd/YmbZoFtXN5PCHzUq8+Hpxw?= =?us-ascii?Q?P9UZ6DPccUBhqrmdWxYDLxC9HHWdeBNjtUZ8+4ijJ2ZAuBSaCJxxSz56ri75?= =?us-ascii?Q?BmV8wxuETdBsDxTgmz9GqN4PJnXYpfeSxUov2RtN/V6f338dHqUAdOnGBqHp?= =?us-ascii?Q?3Bp/mTITpATOXvBVPpcxJi/2TJQq+SUQNRvfwaXePE9tIxpoZXgbg9DAxBoe?= =?us-ascii?Q?iyPZu1RpeBn6+PzM=3D?= X-Forefront-PRVS: 03319F6FEF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39400400002)(39450400003)(39850400002)(76176999)(38730400002)(110136004)(2906002)(305945005)(47776003)(86362001)(66066001)(5660300001)(3846002)(6666003)(50986999)(5003940100001)(81166006)(6916009)(6116002)(478600001)(7736002)(2950100002)(50226002)(6506006)(2361001)(33646002)(6486002)(6512007)(25786009)(42186005)(189998001)(2351001)(4326008)(50466002)(48376002)(53936002)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB753; H:ubuntu.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB753; 23:w9WOeTHl4mNiABRIQGrXLG13UA2rQX+k/C2IXq3WyW?= =?us-ascii?Q?ucw4MaGpzP9uNxa9Nj7J37JNZ/uL2ufXLjcNqvcAMJzosSx9Q7erv3cPtQTO?= =?us-ascii?Q?iuf5zW39q9Uypq97y7ZhdHkkhVtpOc7neV4YBEBfazdNflCTk48maWLgoQxH?= =?us-ascii?Q?Kzz25/D9oZ7y2jDof0xNFhMD+fd1oPFrzvcR2FGoygDpRfUc3qeIaNFYTS2h?= =?us-ascii?Q?Ucd0G7NUFxCcKJTPwRD4tGgFC06oF4yvWKJZpJ7cWHt25bj8DDY46yMYcbz/?= =?us-ascii?Q?oZMW5NlhXgwkgjP0HSckPkWzSbaIxdrMCQt0dyUIytZF19egdjmJSgosavsJ?= =?us-ascii?Q?x6FQIejFBLaNGADQIsStHakJHVNJgPLddOQvRTw6sTzGRuMLfz05IzPMABRw?= =?us-ascii?Q?80aVOyaW4KhQIK1T9j0fC+hVBphxUhiykSlAuVAGgyQKEXhLJ6AfnO4+UDw9?= =?us-ascii?Q?f9xiZJFQtieyiwa89IcqmCw6wl3nOJGNuMNq2nMZXCf+VzxUDvqfWjhouZCt?= =?us-ascii?Q?aipqQwZ501igDPUIt6ojarU1py5J2LeX+ZFGOtYZdo/dBd6nygc4zrNJvmB6?= =?us-ascii?Q?rvccq8XXVavgcHNmi5nm39P6QULrJokdPkpATfWajIC9StUCXOGDh57jTF/p?= =?us-ascii?Q?BKTdcI893mXZioIKZ6/Abt/uEsRHHyMShtnk6e1REj0AJlczYUZQ0iHQl4QK?= =?us-ascii?Q?4Bc0g4ON98BuHNADgcDWOhMnpAPZc3IaKS2yKobOrHF8Y/gheFQV9rQm0u4l?= =?us-ascii?Q?SELHgzba8dGvLXeM3H1FffgxtlrtPkgV1xX09C8GWI10iddJWN4+tVWT6zeC?= =?us-ascii?Q?REZ4B75++EiJVmGMGzaNzgSEUe/32kVAf+3dS8us2fv0xLI+ajT/NuBXYpea?= =?us-ascii?Q?Sd6YIhK2k4ew6LaFWc/SQcR72ZimE/cK7jGf6My4riYRnbDQ54lyqW+n2UVX?= =?us-ascii?Q?6gyPyS2EA3G1OhQxntlIKSWRVPOVAL9fcc5Y23jEhNx3bVHVLf9xq+W9AZuy?= =?us-ascii?Q?YMSJZXKeXSK6u+EBRMjDtW?= X-Microsoft-Exchange-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KksnLs3z6pjU3d7neXkJ/dIWoGCao7vq1grc; 24:SHS+nrCr4kSAGVdQeYX88ymDRYleXDTqAuXrfGSN9WSxFxOWnuOzc9uBO7/9eAwdBxWqZas8dU9g7uiFJjsZalSswTncjwa62mUnRiBfIVM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB753; 7:s5zSaurOHPGmvWu2pL7SUYhm8tlTZEYRXU3Ss7976arrTEmXv3LaQl0UV+DCSqoxAr0f3JsxLaFuFLbTnMSME1oERA7nuYdox40yzK306dMksetUBQkCwkwvFfjutdqN677j09oYJkReltoIM3QGEywtO3Hf9W+ESMpw9s1EoQMKbyMrnkLr+64iv827DbrTb165sG4NGf/vHql4seb+vKl3JnWLYtEdTnV8a2ShaK6KSUfv9FZF6aU1GMQJztTkpu3MPfbb/V3XKvjnqB93Zdsw2m+5aqsjoTQw3zYKlFN1fS4vdXuNps6l6TNOxeidjnStMZUQWSwX50QFr7xYCQ==; 20:efiVZCnoI8ajmYBC5W5p6O3VScqQR4XgHDhVLlIePp0HNO2AuT7YiLfyOkF4LSh1SEEaMXBBvfOWw0EV0ZQ0zR/gNlL6S2DON8HmjCAtOWO2lRT4ztY1pZZPvLIsUCqu0kH8GzFmv5Tldhch6dtVTy33TaEQM/vI0Vs51d7vjkg= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2017 13:24:58.0166 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB753 Cc: stable@vger.kernel.org, Dan Carpenter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Dan Carpenter If vmalloc() fails then we need to a bit of cleanup before returning. Cc: Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Signed-off-by: Dan Carpenter Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c index b6a0806..a1c68e6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c @@ -368,6 +368,8 @@ static void *vmw_local_fifo_reserve(struct vmw_private *dev_priv, return fifo_state->static_buffer; else { fifo_state->dynamic_buffer = vmalloc(bytes); + if (!fifo_state->dynamic_buffer) + goto out_err; return fifo_state->dynamic_buffer; } }