From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.web.de ([212.227.15.14]:65392 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932191AbdJWN5u (ORCPT ); Mon, 23 Oct 2017 09:57:50 -0400 Subject: Re: [PATCH 1/2] xen-tpmfront: Use common error handling code in vtpm_send() To: Jarkko Sakkinen , linux-integrity@vger.kernel.org Cc: Jason Gunthorpe , =?UTF-8?Q?Peter_H=c3=bcwe?= , LKML , kernel-janitors@vger.kernel.org References: <9cfcbfd0-75c3-4de5-f735-0ace23d2abcb@users.sourceforge.net> <20171023134257.txnpbg5c5z7uaquf@linux.intel.com> From: SF Markus Elfring Message-ID: Date: Mon, 23 Oct 2017 15:57:30 +0200 MIME-Version: 1.0 In-Reply-To: <20171023134257.txnpbg5c5z7uaquf@linux.intel.com> Content-Type: text/plain; charset=utf-8 Sender: linux-integrity-owner@vger.kernel.org List-ID: >> @@ -108,11 +106,14 @@ static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count) >> if (wait_for_tpm_stat(chip, VTPM_STATUS_IDLE, duration, >> &priv->read_queue, true) < 0) { >> /* got a signal or timeout, try to cancel */ >> - vtpm_cancel(chip); >> - return -ETIME; >> + goto cancel_vtpm; >> } >> >> return count; >> + >> +cancel_vtpm: >> + vtpm_cancel(chip); >> + return -ETIME; >> } >> >> static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) >> -- >> 2.14.2 >> > > NAK Do you need any more facts to show the influence of the proposed small code reduction? Regards, Markus