From patchwork Sun Dec 25 18:41:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9488303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92707601D7 for ; Sun, 25 Dec 2016 18:42:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C3841FF65 for ; Sun, 25 Dec 2016 18:42:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8038325250; Sun, 25 Dec 2016 18:42:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F25E91FF65 for ; Sun, 25 Dec 2016 18:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754130AbcLYSlv (ORCPT ); Sun, 25 Dec 2016 13:41:51 -0500 Received: from mout.web.de ([212.227.17.12]:53259 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbcLYSlu (ORCPT ); Sun, 25 Dec 2016 13:41:50 -0500 Received: from [192.168.1.2] ([77.182.80.223]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LzsKN-1cZSxo3ZQp-0153y3; Sun, 25 Dec 2016 19:41:43 +0100 Subject: [PATCH 10/19] [media] uvc_driver: Return -ENOMEM after a failed kzalloc() call in uvc_parse_streaming() To: linux-media@vger.kernel.org, Laurent Pinchart , Mauro Carvalho Chehab References: <47aa4314-74ec-b2bf-ee3b-aad4d6e9f0a2@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Sun, 25 Dec 2016 19:41:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <47aa4314-74ec-b2bf-ee3b-aad4d6e9f0a2@users.sourceforge.net> X-Provags-ID: V03:K0:X+pPYXiv2AYqhMepRlH6LJ0yh5TvKWP2aUyzw/ySy4dZSwegTio Z9t/F9K4TUiYd0QJOblLb1qlQk/xwshyk0DBjgsgrmsdINxfBwKHsRSq9GnEmfQnuTMBFin qkQwR2mKhGy0/0OfzMhoRe2KYjc7Lkf/uPe18SdnC/KoldzDZjqEp9OOxfu74Hs6RaZaB4z CyLzsVzUpbbXvI1Ri5ggw== X-UI-Out-Filterresults: notjunk:1; V01:K0:x/B/zxsB76Q=:Ci1zeVUbAgH5GBR3skueuB D0N9ziMEwllXdbBYpYbvkxLOKLXbynp0TQGXBOJYuqr0xagiU2A+pGJ/J8hJyiRK2A0wL27Rp WFuP7YHmoIwTnunLCphf58Agz4nqmT8XKH+HoZ/+lDvWzgkiTU0tBZ7dNRDK4k8wVWeJ5AUGH ok6mRySA8b7SG26dFM0BvVmCysatbHtfKJSNoh9XVwJlcsBZ/fTT1ZoRJXkIwdGOqLLXWnrFW MjB24wKNPAmnIRvYE99UFZVoYJrbIRypVj/wl40SFYoz32aKsETPaBDARiSklieHBPs0wvzdX JIGQNWEwCchLTW0gWAIMR3vMUf4M4a5YLBzSkSmVxMUUgfExTN/m4Lq2yP0XoDaG+f5VJ7GgF Qb/WHBJjNAsW2tVGVBMkPWEh75GF2K4I9KgB1kqm57ET2y06fAZR0Abk6/3G8lLDnfRneouHa VLkyZseIAcZw3s7W7280xPGQ77UIV9p9d97RsSHZ2J8ZwwxNkQsSxtpXwja/T38b+hgwAiuBQ qtFGyjAaywOa0Yxpp6UqTtNMoWE54XbZRDh1G8BSC9oUcd1B0q4gOBwu9fANl+DDY3VkKtLL/ jnsyUY/jSrm8Fxj/l2/w/jdgKkDWMj6l32PtmYfbOVgt3EZ2q7Q8aDNHerK54yJxea00aEd+E hJ241xDn+/1eKuhGTBbook/xg+FWCisz2/HGgZSbRUkiejE5hvfPVLD4QcfK1OHoW0n+T4DwZ SFUfEzasPxtutq49sDepcguKFMYwYVUkVYUubRCA27cuYoX0E6yCXXRgiIQCRVRmwu0EES/i6 6lNcjd6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 25 Dec 2016 16:00:17 +0100 Use the return code "-ENOMEM" (instead of "-EINVAL") after a call of the function "kzalloc" failed here. Signed-off-by: Markus Elfring --- drivers/media/usb/uvc/uvc_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index b0833902fde2..5736f8b26f92 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -663,7 +663,7 @@ static int uvc_parse_streaming(struct uvc_device *dev, streaming = kzalloc(sizeof(*streaming), GFP_KERNEL); if (!streaming) { usb_driver_release_interface(&uvc_driver.driver, intf); - return -EINVAL; + return -ENOMEM; } mutex_init(&streaming->mutex);