From patchwork Sat Jun 21 13:17:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4394111 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 44C239F26E for ; Sat, 21 Jun 2014 13:16:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BE862026C for ; Sat, 21 Jun 2014 13:16:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 075E92024F for ; Sat, 21 Jun 2014 13:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612AbaFUNQ2 (ORCPT ); Sat, 21 Jun 2014 09:16:28 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:54246 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbaFUNQ1 (ORCPT ); Sat, 21 Jun 2014 09:16:27 -0400 Received: by mail-lb0-f182.google.com with SMTP id c11so3063934lbj.13 for ; Sat, 21 Jun 2014 06:16:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=imZoSBpZGrD4z81b4mW+Za3tE8r+qPneow7MaRJRJLQ=; b=labcKFl6oJaCxT9Tp413203x5ETS2CT07TWiUIouQpsL9gL+cmWtMxnUzyA6/V36nu qHkpw+r7JbQ+QqXIqwyXEE9c3WY6s7GA48D5uNPfUS9LHwiv7NczFN1FT2oh98HyGnzM IXJ4tfgcMYQllMnzEybPY1Q46wyFBNdBzOYmw8gu9zSuZjg7QGFCyC5gGabeRbXlRIqw lUFevzCA/uffWT71l94Ixa5AlpJwGS18FurjdESa49WwTtlG/JJn403h8SAZPaAWACKT Fz04HsOE09pe5wsOF7eV7oqLqIrErfbwgLDEraR5KK07JYMAd5kCR7aEUhZPCn83sUrP 7IWw== X-Gm-Message-State: ALoCoQkXiSLFZR1Ne5ge30uQBRQK25Ee6111a1FiOjsbszcH6vCXp9587NKLSmOBeGn+7m0Gy8GR X-Received: by 10.152.4.227 with SMTP id n3mr7345129lan.16.1403356585421; Sat, 21 Jun 2014 06:16:25 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id a13sm8911408lbo.43.2014.06.21.06.16.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jun 2014 06:16:24 -0700 (PDT) From: Rickard Strandqvist To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: Rickard Strandqvist , Jingoo Han , Daniel Vetter , Joe Perches , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: fbdev: skeletonfb.c: Adding code to managing allocation error Date: Sat, 21 Jun 2014 15:17:26 +0200 Message-Id: <1403356646-29443-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding missing code for managing a memory allocation error that may occur. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/video/fbdev/skeletonfb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/skeletonfb.c b/drivers/video/fbdev/skeletonfb.c index fefde7c..ee6dc7e 100644 --- a/drivers/video/fbdev/skeletonfb.c +++ b/drivers/video/fbdev/skeletonfb.c @@ -692,6 +692,7 @@ static int xxxfb_probe(struct pci_dev *dev, const struct pci_device_id *ent) if (!info) { /* goto error path */ + return -ENOMEM; } par = info->par; @@ -746,6 +747,7 @@ static int xxxfb_probe(struct pci_dev *dev, const struct pci_device_id *ent) info->pixmap.addr = kmalloc(PIXMAP_SIZE, GFP_KERNEL); if (!info->pixmap.addr) { /* goto error */ + return -ENOMEM; } info->pixmap.size = PIXMAP_SIZE;