Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp573488ybi; Wed, 19 Jun 2019 04:28:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzljBGFyhB/+/2RrGleJtP2lIjlmMnGSMlXyI7mWRklT/zw0+60ReVQ1STHmdmcDw2Mow4h X-Received: by 2002:a63:3688:: with SMTP id d130mr655808pga.216.1560943688579; Wed, 19 Jun 2019 04:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560943688; cv=none; d=google.com; s=arc-20160816; b=IXijVU16x2Sj8q0Pmp/hHD1rDn1zAk/jwiqwKBUiQCKdxugwC/DESmhL8vtIJ5YYWN JcJ6u795JVEz6QLF0WIYZxMCWJQkK6B2l3snb27Ov2W3Xoej73JgIAk6HBH+Ikqms8CS 2/pT1dr1UQ3wVl17bOZz9ssylQOXrM1v5Lt9WC9Rr0tIea1jTjcBI1WPa4f3k3kmAbCe CdhEfz1r227t24fJRqW0bNZfdDGXRzFf+Tfq76Z/n9tK/UGgjGFHLslJZCXEC9NbaC4o P8dnvJddxN2iWRbdiYeSeWf7tpVAo3E7Q8+8eICXwW4gSXpKdxMa8hCYX1u71YRLLpDL 0zpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=etYGcFEnks2yN8JGdQxznhMIsyTtgXaDEBB4fWgtiIU=; b=evE/aEv6dLVa2EqdczZV1Q+fSQrHcgb2DF3tREvOPXy68PcmmNn49liXH/0zY5nMnI CV8ZYNZqpNe65Sp1uFr7r/8R+YddvYrV2X2WmOfS8ZnMI3S6g4DguDJUAEn3ZDQgnYvn aF78adz807lqL53AaJ9heElqr+slfDYgtPWTzXYtzhsxrG1Sx1qheZGKHGvH3VQ0Ya/r Wi089C8zG/xUxX3NPhRjbVEU7eQihsNCEEXjMuyy6izBi6+Ro89n5wSCCq8CGMTonFJP IuwIxmevGH/Klnsou5ELpPqtkKRZsZ0+akbmMfemcxcFk5RkjN70vCduGOBp74yL8oUK +OjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg11si1100943pjb.72.2019.06.19.04.27.53; Wed, 19 Jun 2019 04:28:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731653AbfFSL1W (ORCPT + 99 others); Wed, 19 Jun 2019 07:27:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727076AbfFSL1W (ORCPT ); Wed, 19 Jun 2019 07:27:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7906530860AF; Wed, 19 Jun 2019 11:27:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-212.ams2.redhat.com [10.36.116.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 432005D9C6; Wed, 19 Jun 2019 11:27:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7E84E11AAB; Wed, 19 Jun 2019 13:27:23 +0200 (CEST) Date: Wed, 19 Jun 2019 13:27:23 +0200 From: Gerd Hoffmann To: Emil Velikov Cc: dri-devel@lists.freedesktop.org, Maxime Ripard , open list , David Airlie , Sean Paul Subject: Re: [PATCH v3 01/12] drm: add gem array helpers Message-ID: <20190619112723.sktnns3qfdfh3lvi@sirius.home.kraxel.org> References: <20190619090420.6667-1-kraxel@redhat.com> <20190619090420.6667-2-kraxel@redhat.com> <20190619103212.GA1896@arch-x1c3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190619103212.GA1896@arch-x1c3> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 19 Jun 2019 11:27:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +struct drm_gem_object_array* > > +drm_gem_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents) > > +{ > > + struct drm_gem_object_array *objs; > > + u32 i; > > + > > + objs = drm_gem_array_alloc(nents); > > + if (!objs) > > + return NULL; > > + > > + for (i = 0; i < nents; i++) { > > + objs->objs[i] = drm_gem_object_lookup(drm_file, handles[i]); > > + if (!objs->objs[i]) { > Missing object put for the 0..i-1 handles. Personally I would: No. drm_gem_array_alloc initializes objs->nents and drm_gem_array_put_free() loops over the whole array, skipping NULL pointers. > > + drm_gem_array_put_free(objs); > > + return NULL; > > + } > > + } > > + return objs; > > +} > Missing EXPORT_SYMBOL? Oops. I had that fixed. Possibly squashed into the wrong patch. > Ditto? Yes. cheers, Gerd