From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Szymon Janc To: Marcin Kraglak Cc: linux-bluetooth@vger.kernel.org Subject: Re: [PATCHv2 03/11] android/gatt: Service error when client cannot be created Date: Thu, 27 Mar 2014 22:46:33 +0100 Message-ID: <1600854.BLWGsHvyoh@athlon> In-Reply-To: <1395954789-32459-3-git-send-email-marcin.kraglak@tieto.com> References: <1395954789-32459-1-git-send-email-marcin.kraglak@tieto.com> <1395954789-32459-3-git-send-email-marcin.kraglak@tieto.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Marcin, On Thursday 27 March 2014 22:13:01 Marcin Kraglak wrote: > If memory allocation failed, return error from handle_client_register. > --- > android/gatt.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/android/gatt.c b/android/gatt.c > index 1af7e33..2e93ef7 100644 > --- a/android/gatt.c > +++ b/android/gatt.c > @@ -239,6 +239,11 @@ static void handle_client_register(const void *buf, > uint16_t len) } > > client = new0(struct gatt_client, 1); > + if (!client) { > + error("gatt: cannot allocate memory for registering client"); > + status = HAL_STATUS_FAILED; > + goto failed; > + } > > memcpy(client->uuid, cmd->uuid, sizeof(client->uuid)); This patch is now pushed, thanks. -- Szymon K. Janc szymon.janc@gmail.com