From patchwork Mon Jun 23 08:53:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 32337 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BEE4720540 for ; Mon, 23 Jun 2014 08:53:56 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id va2sf21589658obc.2 for ; Mon, 23 Jun 2014 01:53:56 -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 :mime-version: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=yqm/2swwbhT8SadbHMLF/ftRB40sd7MZlhBuxSkQUZI=; b=hFNkYtlxKyJYNkR3IEQJ5SGCjXHD6hosVTih7WoSRk3VpspunCX33rp84095NB1NVu q2N3NP0oottGD2N59s8fe2HYm6zWKmxoZ44qfJ86bqyfbsJc+KaIfUOatn5BDOAXFNEZ EgYHlpxStKu/S2JRE56+f26IFAAhFBvZDQQ+WO0T/CNbFx4cutpR/9oYZuJtPLRQm03i NUVSOSMXPJ8bIGyxi/pbFJH+40q+NUcGZ1VQ4065HLVNJkXRxAY6D5n9Uq4YyFflp7ou bZY/Ej+oj1ppPZvAHp7hpmx8rbvWd87y/x4NIyhQ12JVwD8ZrvAQz7URw4UOBqg2j64g Q9Pg== X-Gm-Message-State: ALoCoQnljrmmzVviHQaA4KdlEx+AhnsZTrihgp+GwQ6fOSxPlROW/3xWicbckLycFSRfqQBUQ6oK X-Received: by 10.50.98.69 with SMTP id eg5mr9110007igb.7.1403513636273; Mon, 23 Jun 2014 01:53:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.204 with SMTP id 70ls1506626qgv.21.gmail; Mon, 23 Jun 2014 01:53:56 -0700 (PDT) X-Received: by 10.58.208.228 with SMTP id mh4mr18353208vec.22.1403513636171; Mon, 23 Jun 2014 01:53:56 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id p3si8622733vcz.34.2014.06.23.01.53.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 01:53:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hy4so5612622vcb.34 for ; Mon, 23 Jun 2014 01:53:56 -0700 (PDT) X-Received: by 10.58.29.234 with SMTP id n10mr18555820veh.16.1403513635925; Mon, 23 Jun 2014 01:53:55 -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 tc5csp115321vcb; Mon, 23 Jun 2014 01:53:55 -0700 (PDT) X-Received: by 10.68.203.233 with SMTP id kt9mr27099867pbc.61.1403513635152; Mon, 23 Jun 2014 01:53:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ef2si2664318pbb.106.2014.06.23.01.53.54; Mon, 23 Jun 2014 01:53:54 -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 S1753692AbaFWIxx (ORCPT + 9 others); Mon, 23 Jun 2014 04:53:53 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:52837 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205AbaFWIxu (ORCPT ); Mon, 23 Jun 2014 04:53:50 -0400 Received: by mail-ie0-f174.google.com with SMTP id lx4so5368041iec.5 for ; Mon, 23 Jun 2014 01:53:50 -0700 (PDT) X-Received: by 10.42.39.203 with SMTP id i11mr20754478ice.23.1403513629955; Mon, 23 Jun 2014 01:53:49 -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 e4sm30838408igx.4.2014.06.23.01.53.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 01:53:49 -0700 (PDT) Date: Mon, 23 Jun 2014 09:53:45 +0100 From: Lee Jones To: gnomes@lxorguk.ukuu.org.uk Cc: linux-kernel@vger.kernel.org Subject: Alan, can you revisit a patch you authored please? Message-ID: <20140623085345.GD8847@lee--X1> MIME-Version: 1.0 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.220.175 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 Hi Alan, I'm looking at a patch you wrote which can be foudn below at [1]. Are you sure it's correct to ignore i.e not return -ENOMEM from platform_device_add_data() in pcf50633_probe()? I believe if platform_device_add_data() returns an error we should platform_device_put() and return immediately. Can you tell me if you agree. If you don't, would you mind explaining to me why please? Kind regards, Lee [1] 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);