From patchwork Wed Aug 31 13:45:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9307283 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 72330601C0 for ; Wed, 31 Aug 2016 13:52:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6473728F23 for ; Wed, 31 Aug 2016 13:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 590E728F33; Wed, 31 Aug 2016 13:52:49 +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=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 027AF28F23 for ; Wed, 31 Aug 2016 13:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934597AbcHaNwr (ORCPT ); Wed, 31 Aug 2016 09:52:47 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:46410 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933390AbcHaNwr (ORCPT ); Wed, 31 Aug 2016 09:52:47 -0400 X-Greylist: delayed 452 seconds by postgrey-1.27 at vger.kernel.org; Wed, 31 Aug 2016 09:52:46 EDT Received: from localhost.localdomain ([92.140.166.52]) by mwinf5d69 with ME id dpl91t00M189VV003plAdd; Wed, 31 Aug 2016 15:45:12 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 31 Aug 2016 15:45:12 +0200 X-ME-IP: 92.140.166.52 From: Christophe JAILLET To: mchehab@kernel.org, gregkh@linuxfoundation.org Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] [media] s5p_cec: Fix memory allocation failure check Date: Wed, 31 Aug 2016 15:45:04 +0200 Message-Id: <1472651104-17097-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.7.4 X-Antivirus: avast! (VPS 160829-1, 29/08/2016), Outbound message X-Antivirus-Status: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is likely that checking the result of the memory allocation just above is expected here. Signed-off-by: Christophe JAILLET --- drivers/staging/media/s5p-cec/s5p_cec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/staging/media/s5p-cec/s5p_cec.c index 78333273c4e5..636bac182e8e 100644 --- a/drivers/staging/media/s5p-cec/s5p_cec.c +++ b/drivers/staging/media/s5p-cec/s5p_cec.c @@ -173,7 +173,7 @@ static int s5p_cec_probe(struct platform_device *pdev) int ret; cec = devm_kzalloc(&pdev->dev, sizeof(*cec), GFP_KERNEL); - if (!dev) + if (!cec) return -ENOMEM; cec->dev = dev;