From patchwork Wed Nov 21 09:06:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13035 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CCFB223FC9 for ; Wed, 21 Nov 2012 09:21:15 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 79932A19BF5 for ; Wed, 21 Nov 2012 09:21:15 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so9541413iej.11 for ; Wed, 21 Nov 2012 01:21:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=4G5CSdaexNOwIACb6ptBoNgEYV64M+wNuUcwtqiIHbE=; b=mxb/8Ngd7DRKCuQbcM8Nm9IUZqDBF6d8q0BPaYPgT/Qof1kL6PtXNtI7l0kkMtP/fC sNLYCgXb2fo0zSeElRdIrljapzGhEs6YmvUkw5FyqvAP9+gI03XDgktBQfYcnJU53mvC XygS3V4YMXwig5/yDIHH/YfitOoMait6bfdpUDVRF7BF311QqE2K0Ks81gWlrjHSU6FO 3AhaYk/gM7bwANSICDyoCVkUuQvwNd4L2fqFbLnlzZrhF0jogT6mZWLeD91Q76yI0qY5 uWf2ffw98YEjkE2uCHaYAovL25ErB7yI7f1hUO8IMymnvv9sMpQbgwraPiTk/PrwuI4z eCMA== Received: by 10.43.125.133 with SMTP id gs5mr16705893icc.54.1353489674900; Wed, 21 Nov 2012 01:21:14 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp681igt; Wed, 21 Nov 2012 01:21:14 -0800 (PST) Received: by 10.68.241.232 with SMTP id wl8mr51265203pbc.144.1353489233496; Wed, 21 Nov 2012 01:13:53 -0800 (PST) Received: from mail-da0-f44.google.com (mail-da0-f44.google.com [209.85.210.44]) by mx.google.com with ESMTPS id h2si21507666pay.135.2012.11.21.01.13.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 01:13:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f44.google.com with SMTP id z20so227784dae.17 for ; Wed, 21 Nov 2012 01:13:27 -0800 (PST) Received: by 10.69.0.40 with SMTP id av8mr51708707pbd.117.1353489206970; Wed, 21 Nov 2012 01:13:26 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mn5sm9621802pbc.12.2012.11.21.01.13.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 01:13:26 -0800 (PST) From: Sachin Kamat To: alsa-devel@alsa-project.org Cc: perex@perex.cz, tiwai@suse.de, broonie@opensource.wolfsonmicro.com, lrg@ti.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 5/6] ALSA: usb-audio: Return -ENOMEM on memory alloc failure in format.c Date: Wed, 21 Nov 2012 14:36:58 +0530 Message-Id: <1353488819-13902-5-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353488819-13902-1-git-send-email-sachin.kamat@linaro.org> References: <1353488819-13902-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQn3pTy+C67TMmF9oB1+TNhqXzlh+fqeLF49KyVK6MPGI/roWnNgVEtAloZ+Emdev86lz3TS Return -ENOMEM instead of -1 to silence the following smatch warning: sound/usb/format.c:170 parse_audio_format_rates_v1() warn: returning -1 instead of -ENOMEM is sloppy Signed-off-by: Sachin Kamat --- Build tested and based on linux-next 20121115. --- sound/usb/format.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sound/usb/format.c b/sound/usb/format.c index ddfef57..d033d4d 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -167,7 +167,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL); if (fp->rate_table == NULL) { snd_printk(KERN_ERR "cannot malloc\n"); - return -1; + return -ENOMEM; } fp->nr_rates = 0;