Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp456150imm; Thu, 12 Jul 2018 23:59:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdb7164gxKAj38Q2slTVIWfvwl60vEtma35FVnlpVyB7AVGBT7FPqmwMSBZlt6qPM0xrkyn X-Received: by 2002:a63:5a13:: with SMTP id o19-v6mr4873312pgb.195.1531465142321; Thu, 12 Jul 2018 23:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531465142; cv=none; d=google.com; s=arc-20160816; b=cZAOZWIAiCK9IdpkUClWYV25gW+vHgYvumK/NutiqHKrsLJnc84p1t5tf7hTFqOurt oeecsnEPwfshjT051GbuwuKNypcelxUswq1zXg5HmLgkgIblc9Gw5YKXyypfdDGuLEXf a7IerT6OwZ/XKLvUJ4pTbGWnNRr+znMtpmbN2cWdb5tT2oS5xcjAeuCMA5yGBurxkiGh C7k7kVgZ+KJ5OMOubqgSqD5QL2KRf4jCmLqv9t2oo1QwUpJ11/nI31xtBayABpb/Brci X1IE/qifHGYQAK36RWwCN6sJC/wcueVl+t/mK5WIFIPlNJapcLzQHdsOE3BBKacbSgB9 /2Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:from:date:message-id:mime-version :user-agent:dkim-signature:arc-authentication-results; bh=kTcueVnqZTsU3LhEc+5V6sY6+wHDA8HKaReRVWjb2zE=; b=dIkEpXeSOo+4SJbLklCyZnEbrxohzn3v4peCZXEFy3QYX+mmqKtdHZbFKxGyFkp+HR nhioK6UPeYsaM5qJuHoAqyyA9OMnnv3oXPCKwYovQUI45XtBxYk0yKAk83V1jIgu7nXO UE+stwrR4+PqoEQqfWdKJTadtQ5KVzT0vub+2VEtZVTpu74qfO4ihTtbXBgqYOuFzpYG 5eGTUpmQG/UI+YV4ZFRZdgCxPenhikf7lmtRdolBynTjzDYX8T5Xmv4RDVH2+l86MKW2 kQdyLHTEEeDNeyJ8g9phPlpLJRWtgYRyXgLQ9Caz/bn8nmmWQuYy6bZY7kWxny6gcCQj hxpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="0H7ju8i/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34-v6si23045766ple.165.2018.07.12.23.58.45; Thu, 12 Jul 2018 23:59:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="0H7ju8i/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729645AbeGMHLZ (ORCPT + 99 others); Fri, 13 Jul 2018 03:11:25 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:40952 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727569AbeGMHLZ (ORCPT ); Fri, 13 Jul 2018 03:11:25 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6D6o49i191018; Fri, 13 Jul 2018 06:57:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=kTcueVnqZTsU3LhEc+5V6sY6+wHDA8HKaReRVWjb2zE=; b=0H7ju8i/nonrvndOVFXRY0yxFmbHEBlekTnpeufDHa/ijjKH0DmlR9tshQqKsMbqsH84 iChzZgc1yWtBX/x8yAVvrC2uBvMkgQJV62UU4AotSDyY7wrj1st7u6Cj548THhSW7LTj lg0/hCmePsxla8tJR375oslHgrIJzpHozTd/XcwIicPiY61UxKTJd/R5m5dBB67P7NZI zeYihe8bPipf73CItpZgiYvkL3xbaxuPMBHRTyjXbIo6i/WmuFaVyS9abzo/rzFewKQu Xs74BBz3fw5VwaYLYKplmbHFpqW28WD5lnKBLF6bgG8oT9z83ewr95lnBrIjtt4zGiPx MA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2k2p7e6g68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jul 2018 06:57:47 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6D6vlZj004525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jul 2018 06:57:47 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6D6vhha012325; Fri, 13 Jul 2018 06:57:43 GMT Received: from mwanda (/41.202.241.32) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 13 Jul 2018 06:57:32 +0000 USER-AGENT: NeoMutt/20170609 (1.8.3) MIME-Version: 1.0 Message-ID: <20180713065721.a5cntccedumupewo@mwanda> Date: Thu, 12 Jul 2018 23:57:22 -0700 (PDT) From: Dan Carpenter To: Tuomas Tynkkynen Cc: Stefan Wahren , devel@driverdev.osuosl.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Eric Anholt , linux-rpi-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] staging: bcm2835-audio: Check if workqueue allocation failed References: <20180712215417.22491-1-tuomas@tuxera.com> <20180713064816.lv6qhkipi6fpeptj@mwanda> In-Reply-To: <20180713064816.lv6qhkipi6fpeptj@mwanda> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8952 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=913 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807130042 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 13, 2018 at 09:48:16AM +0300, Dan Carpenter wrote: > On Fri, Jul 13, 2018 at 12:54:16AM +0300, Tuomas Tynkkynen wrote: > > @@ -424,7 +411,9 @@ int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream) > > int status; > > int ret; > > > > - my_workqueue_init(alsa_stream); > > + alsa_stream->my_wq = alloc_workqueue("my_queue", WQ_HIGHPRI, 1); > > + if (!alsa_stream->my_wq) > > + return -ENOMEM; > > > > ret = bcm2835_audio_open_connection(alsa_stream); > > if (ret) { > > This patch is good but if bcm2835_audio_open_connection() fails then > we need to release alsa_stream->my_wq. Never mind, you handle it in the next patch. The bug *was* there in the original code as well, so that's a legit way to split the patches. regards, dan carpenter