From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034425AbcIYPlV (ORCPT ); Sun, 25 Sep 2016 11:41:21 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34745 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938905AbcIYPlU (ORCPT ); Sun, 25 Sep 2016 11:41:20 -0400 From: Wei Yongjun To: Greg Kroah-Hartman , Christian Gromm , Andrey Shvetsov , Shraddha Barke Cc: Wei Yongjun , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH -next] staging: most: fix error return code in audio_probe_channel() Date: Sun, 25 Sep 2016 15:41:11 +0000 Message-Id: <1474818071-18972-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun Fix to return a negative error code from the audio_set_hw_params() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/staging/most/aim-sound/sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c index 3dc625c..00f01c9 100644 --- a/drivers/staging/most/aim-sound/sound.c +++ b/drivers/staging/most/aim-sound/sound.c @@ -607,7 +607,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id, channel->id = channel_id; init_waitqueue_head(&channel->playback_waitq); - if (audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg)) + ret = audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg); + if (ret) goto err_free_card; snprintf(card->driver, sizeof(card->driver), "%s", DRIVER_NAME);