From patchwork Mon Jun 23 08:47:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 32336 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 61B4A20540 for ; Mon, 23 Jun 2014 08:47:54 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id r10sf22699084pdi.10 for ; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition:content-transfer-encoding; bh=Kc324demk8NHfhAXp/Mimv2IW5/aPoj4yk3gHwffM6o=; b=CUIhicwqd9ErbTwkszcPe+MavB0pNcyLZZjeAQ7WOy0jg86uUAGhyrPGOit5J/xiKF d0uRkDE584q0T7fvpzPQ/we4naM707lH1lCZZpIR8iEgOBjp0nIdYUIrBsYgIAAIlr4M HMAuG7+DsmonNpQwMwOGjbD7T7hUG7Pe3CsUYSTmnqG6hAYBNrdoWepxyojT6xqEULTU 9VGMaZ1gfsqE2hMIx29FUHcyOG0Kiwzr/fpES2noa/z66N+ZMUT3D0MX2EmsVexlz/WX Nay8TR7esK3W0cnCeUUUR65QppJ7ANOxK8fn6AhU+WSjuKBQGR5ToNAXMhQGVLk0cuCR Tbrw== X-Gm-Message-State: ALoCoQne/dGEZmwt0wUft4q+aLEV2wDYF8XiT2FOkgowUIRZrHV9sfeuRowOkUevlrUdWQZy6LNt X-Received: by 10.66.217.170 with SMTP id oz10mr9670573pac.9.1403513273726; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.78 with SMTP id v72ls1836322qge.0.gmail; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) X-Received: by 10.52.163.161 with SMTP id yj1mr9451275vdb.35.1403513273582; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id bw1si8617820vcb.18.2014.06.23.01.47.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 01:47:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so5744454veb.41 for ; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr18069762vcb.23.1403513273488; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp115033vcb; Mon, 23 Jun 2014 01:47:53 -0700 (PDT) X-Received: by 10.68.186.130 with SMTP id fk2mr26831495pbc.60.1403513272654; Mon, 23 Jun 2014 01:47:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pi1si20853431pbb.62.2014.06.23.01.47.52; Mon, 23 Jun 2014 01:47:52 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144AbaFWIrt (ORCPT + 9 others); Mon, 23 Jun 2014 04:47:49 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:56386 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981AbaFWIrq (ORCPT ); Mon, 23 Jun 2014 04:47:46 -0400 Received: by mail-ie0-f174.google.com with SMTP id lx4so5588849iec.33 for ; Mon, 23 Jun 2014 01:47:46 -0700 (PDT) X-Received: by 10.43.13.132 with SMTP id pm4mr20979858icb.6.1403513266007; Mon, 23 Jun 2014 01:47:46 -0700 (PDT) Received: from lee--X1 (host109-148-235-194.range109-148.btcentralplus.com. [109.148.235.194]) by mx.google.com with ESMTPSA id t16sm30777783igr.14.2014.06.23.01.47.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 01:47:45 -0700 (PDT) Date: Mon, 23 Jun 2014 09:47:41 +0100 From: Lee Jones To: Nick Krause Cc: sameo@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: Obsolete Bug in file drivers/mfd/pcf50633-core.c Message-ID: <20140623084741.GC8847@lee--X1> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline On Fri, 20 Jun 2014, Nick Krause wrote: > There seems to be a obsolete bug in this file that has been reported about > a NULL > check for platform_device_add_data() in function pcf50633_probe(). This > bug seems > to be fixed by the lines I wrote in my comment on Bugzilla. The attached > link should > give you an idea of if closing this bug is a good idea. > https://bugzilla.kernel.org/show_bug.cgi?id=78521 > > Thanks Nick This bug was fixed by Alan Cox 2 years ago: commit 18273c5b463d9f98ef81f1a6217a7f4168dd809a Author: Alan Cox Date: Fri Jul 13 16:43:32 2012 +0100 mfd: Add missing out of memory check for pcf50633 Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44561 Reported-by: Cc: Lars-Peter Clausen Signed-off-by: Alan Cox Signed-off-by: Samuel Ortiz diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 29c122b..45ce1fb 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client, } pdev->dev.parent = pcf->dev; - platform_device_add_data(pdev, &pdata->reg_init_data[i], - sizeof(pdata->reg_init_data[i])); + if (platform_device_add_data(pdev, &pdata->reg_init_data[i], + sizeof(pdata->reg_init_data[i])) < 0) { + platform_device_put(pdev); + dev_err(pcf->dev, "Out of memory for regulator parameters %d\n", + i); + continue; + } pcf->regulator_pdev[i] = pdev; platform_device_add(pdev);