From patchwork Wed May 16 09:28:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10403137 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 C9CA4601C8 for ; Wed, 16 May 2018 09:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B933828834 for ; Wed, 16 May 2018 09:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD9982883C; Wed, 16 May 2018 09:29:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1772C28834 for ; Wed, 16 May 2018 09:29:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbeEPJ3Y (ORCPT ); Wed, 16 May 2018 05:29:24 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:41984 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751046AbeEPJ3W (ORCPT ); Wed, 16 May 2018 05:29:22 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4G9QqPH014208; Wed, 16 May 2018 09:29:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=94ocWbI+/Ifnq4osJuLZnESgZm/rY25cWJKyuUO5zQg=; b=jKtKnfB95G6pVMcvacnplLoiQETRp38WxrnUeWQ5no5s76Tq9607BK0Mz9dFLPPJmcmb R8GgUI/M19mFPBORui8fh7c1j1nWRsklZTs0H4HEk6XrS2upfpyq80XOs/wb2RuaUXoa L9EaM7EKEdhMZOzWced0PFfvj89IoGOPG2rIukXcn0vsdV+VeJlyzoXhrpMpObHhj3gs kw6e1sp2S57zX+v2Z+/vakQcVmvi5NWeePQgzQRCSO3w7xhNtcQRbvvPWOlyFEQOHleI vy+keM6qkJrF2fVw38yABNNVbC5RgyHBfMG+dZgt8fpXTAze0FHOHj0Bp9TtG3VNNEuc 6A== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2hx29w3yte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 09:29:07 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4G9T5CG002378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 09:29:06 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4G9T5td008342; Wed, 16 May 2018 09:29:05 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 16 May 2018 02:29:04 -0700 Date: Wed, 16 May 2018 12:28:57 +0300 From: Dan Carpenter To: Kirti Wankhede , Gerd Hoffmann Cc: kvm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] sample: vfio/mdev: add a missing error code Message-ID: <20180516092857.GA25195@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=728 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805160095 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We forgot to set "ret = -ENOMEM;" here. Fixes: 2933b7a9b2fd ("sample: vfio mdev display - guest driver") Signed-off-by: Dan Carpenter diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c index 2719bb259653..6fe0187f47a2 100644 --- a/samples/vfio-mdev/mdpy-fb.c +++ b/samples/vfio-mdev/mdpy-fb.c @@ -131,8 +131,10 @@ static int mdpy_fb_probe(struct pci_dev *pdev, width, height); info = framebuffer_alloc(sizeof(struct mdpy_fb_par), &pdev->dev); - if (!info) + if (!info) { + ret = -ENOMEM; goto err_release_regions; + } pci_set_drvdata(pdev, info); par = info->par;