From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNGo-00034H-R5 for qemu-devel@nongnu.org; Wed, 29 Apr 2015 04:23:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnNGl-0003Nj-Js for qemu-devel@nongnu.org; Wed, 29 Apr 2015 04:23:02 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:35241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNGl-0003Nf-Co for qemu-devel@nongnu.org; Wed, 29 Apr 2015 04:22:59 -0400 Received: by widdi4 with SMTP id di4so170034926wid.0 for ; Wed, 29 Apr 2015 01:22:58 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <554094DF.3010607@redhat.com> Date: Wed, 29 Apr 2015 10:22:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430239873-31950-1-git-send-email-eric.auger@linaro.org> <1430239873-31950-11-git-send-email-eric.auger@linaro.org> In-Reply-To: <1430239873-31950-11-git-send-email-eric.auger@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v13 10/12] qdev: check callback takes the property child as third argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Auger , eric.auger@st.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, agraf@suse.de, peter.crosthwaite@xilinx.com Cc: kvmarm@lists.cs.columbia.edu, patches@linaro.org On 28/04/2015 18:51, Eric Auger wrote: > - prop->check(obj, name, new_target, &local_err); > + object_ref(new_target); > + *child = new_target; > + > + prop->check(obj, name, child, &local_err); > if (local_err) { > error_propagate(errp, local_err); > + *child = old_target; > + object_ref(new_target); This should be an unref. Paolo > return; > } > > - object_ref(new_target); > - *child = new_target; > object_unref(old_target);