Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp506244ybz; Fri, 24 Apr 2020 04:25:08 -0700 (PDT) X-Google-Smtp-Source: APiQypLJR1AKval1iwoQCgv/9Spf6RsbYjkA4LSVfsbzb5ZITdQJO82s/vTWYebwnrVjb0BOJ4Wf X-Received: by 2002:a17:906:5e45:: with SMTP id b5mr6489977eju.0.1587727508101; Fri, 24 Apr 2020 04:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587727508; cv=none; d=google.com; s=arc-20160816; b=C5ghghm4QtlXq/S5/zdvW62MifPzcUQEICWLbeFc48zkgkBeAtTusGqklLL+91KYlF ttiPeU2Gxes4qTS2AVd1MEBPJf/PdBbpdwuPa1BdayyBnEUnZkNLsVSv+Guq8XG7DmA+ HdxEgj64htcCH8NZ2oKkl+RTdW/rD+71mevc6Z1Kst4E45m7pswmPWZWBE++LRigAqpK lvvlSu9/5yPT3NUzAr1elYI7gUjgRnX6quWDe3/dhwfJYRv26mSL03x7zSAotjOw63To jNWwNNXPdkwBFl9MIoNTZQY7dvsE1dguVPy8dQbnJe45CRCs8X8mPzAg0i2sOi4cMUMS aYMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=jLbwp4z2a8ywYtIlNFO6bEPpuvqBJMQUIkngUPj6OKQ=; b=lIIc970PvGeAd5KK3Nh0Zt0H3HQQy0lxooNIj4x/yS4hGab3t0a7PBhpO4e/+lHDVj S1PpBY1/I/rKNGG3ZmyS8zxRcpmpPgjQjh7SUdpJuWarmTklENlVB+1AfVuCWJebxvcV 2YNYfzbLahd5aZG7xf0QF83oGJC4oE+/pk8PrfVqBgMrbOugYFX8G+KAiqg33sw8O89E fmfXzIoqhQmtJaDq/rqDp+fbtgx7oX4RdONwtCW50wvKF9FvVPy7QnmQSWll95yqTBr7 kr2TWilOuq7o85Tg7BCT3pe0Tn4lvbmkZ+QZWNTdfXvPux/TuxEHokKZP9FCCzuWvAS0 wRKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=PhgTcim1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si2868592ede.176.2020.04.24.04.24.42; Fri, 24 Apr 2020 04:25:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=PhgTcim1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726899AbgDXLWR (ORCPT + 99 others); Fri, 24 Apr 2020 07:22:17 -0400 Received: from smtp1.axis.com ([195.60.68.17]:25426 "EHLO smtp1.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgDXLWR (ORCPT ); Fri, 24 Apr 2020 07:22:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; l=534; q=dns/txt; s=axis-central1; t=1587727337; x=1619263337; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=jLbwp4z2a8ywYtIlNFO6bEPpuvqBJMQUIkngUPj6OKQ=; b=PhgTcim1dlGSCJLMLVJryO28X9eb9CMFEABgTbGmT8+O12yg6Y8uFP04 h0H134e15+vhYPBwbzk36YjiDj/6wKRb12I5SVDNXv0ddjM7Okff/3uoX UaycZykOWDsKmxREz1noMa43QNQO8XpVMBJcZQyVx5Nq6Y3PPVRza2K/5 tsCD7QM5/jNyglUr6a2AYVIapyEoIxeARIWphEE5bjDuqlFrUZSTd6W8N Y6ZxVLELxUsFgNSGSvsubTWmhrbBhQBHcZ6hmfX4jXSeGb95DvjVZkk7C nzUBJA0SGNHmz2yZ3lx0KWW33Ps4NNZVe35wXtaFy012gxzUzfh9Vaf/L Q==; IronPort-SDR: Mczf+wSEy9tXf4x1FqTOMvRi/WpV2jaYEX5zFbFC1ZTCtx6+CsBKXBbTeqEaeW0IN++enSIaV9 LcHDwJDfVVX4SBoh72YG+Jokyo5YpwidvKEREb6BHHUl2aRfocorIVFoDKof9lYs+5uQlpkA1D dISFs6e9UX6Vv0bU1r8VPxKhe9styPW5i+3DLKx2h9A3WYPd0YXsBvq1qT+LJLAeQjTEecmZN8 9kVwYnOqULEl7TzSgReQvTLuRiEaFbXDLObOGL6665P/JfiTzGn8TuLra70qekGpkTIhYMFDTL mwc= X-IronPort-AV: E=Sophos;i="5.73,311,1583190000"; d="scan'208";a="8007496" Subject: Re: [PATCHv2] i2c: slave-eeprom: Make it possible to pre-load eeprom data To: Wolfram Sang CC: , , , References: <20200424090443.26316-1-bjorn.ardo@axis.com> <20200424111337.GC1959@kunai> From: Bjorn Ardo Message-ID: <5038e4c1-440b-0a56-978b-a8c9fac061cc@axis.com> Date: Fri, 24 Apr 2020 13:22:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200424111337.GC1959@kunai> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: XBOX03.axis.com (10.0.5.17) To XBOX02.axis.com (10.0.5.16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/20 1:13 PM, Wolfram Sang wrote: > On second look, two questions: > >> + if (!error) { >> + int ret = request_firmware_into_buf(&fw, eeprom_data, &client->dev, >> + eeprom->buffer, size); >> + if (ret) >> + return ret; > Aren't we leaking 'fw' here? As I can see in drivers/base/firmware_loader/main.c in function _request_firmware, then the fw will be released internally if it returns an error value. > Also, do we need 'error' and 'ret'? Can't we reuse one of them? Yes, I can fix that. /BA