Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp450545imm; Thu, 12 Jul 2018 23:50:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdsFOX9jyiJah4XVXzYkfGGoddn7S05n+qdvzadegJXeiERFAWL3SyfFp5gLNWr2kn8TW9a X-Received: by 2002:a63:a042:: with SMTP id u2-v6mr4851007pgn.80.1531464636611; Thu, 12 Jul 2018 23:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531464636; cv=none; d=google.com; s=arc-20160816; b=GhK9Snjkgbpsd7mTaGScktIdXRVWoeN15mhFJHXGgUqswRF4o3iadUEdGjleyGKGwP tlx5tFizHELukuHMssYqYzsmDAoaB0FY69QOxxBELZ7ArInbq3vCoRQub0hwNB4KlN2o R/Gzwmb7tBlRGKXXv38XXtVFGxuD0rzRJv+0Ft9sR+Jfi0IZvY0Ev9HxrmH6vLQYQ+8d 8uS6Dyr243N+s4yeIbL5nMe8VaVRyX/6b/dMTphQ9/V0fwVXuLXkjul5GEiH3tIGExsV CSLaQa7i9KKY+TSixoTo7nJ1/osr7U1Jix7cvOATJeQk0IJiuNqK4KeTgI0S+ED5vM0H 5aUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=4QBgxmDDs++p7LUq1dnfA+0H1QRSbE8tSUX3/pQgfnw=; b=XQhlJkmYbcwLGSWID0ubG/kY7912n9VUZMS7J2DI76U9eP7c5DRECg3dVIwvkydlMf 28t0IWWAe/eY8bHCAWqk+rFip75NBnt2dPcI5lBur+63LXPSAdTOusbdinYmp2aToe4U pOp7C+RnbpNBwQ8orSNK+oYgNbCjtGu/PX0qwCr/Fx8LuL7vsFMDI3w7J0jbeIyH8ceX 8g5wRMP7x1XGN3xdUmpczT/ZnRrLLuL3jYqkVqd5LnKnnxIp7e89FVAMFLy+NbHDjj9z HYyV/po8Vzad4a6btZoA6pnhyoA7eb8WEzKzGGNwHsxBDo9yuxtz4F7VGCp/r/zx/x1l Q99w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=eINKMbMZ; 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 d24-v6si25534407pfb.262.2018.07.12.23.50.21; Thu, 12 Jul 2018 23:50:36 -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=eINKMbMZ; 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 S1729667AbeGMHCm (ORCPT + 99 others); Fri, 13 Jul 2018 03:02:42 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:34382 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbeGMHCm (ORCPT ); Fri, 13 Jul 2018 03:02:42 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6D6mmSh150419; Fri, 13 Jul 2018 06:49:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=4QBgxmDDs++p7LUq1dnfA+0H1QRSbE8tSUX3/pQgfnw=; b=eINKMbMZ7VWjlpt9AVNS00ggd247gtA1k6iNHIDoZdK4fT3h84eX9+n/7OGZj/XIACz5 F0NtGZE0zP7LOyiBlz+W+Wt9Jqm6dgULRg2ykPl0Z+CkHLmcFt8t9ddsCfu+duSh7iB2 bnljXAz0vXnRqj5/5ZC1TLRmMNQpyOE90gznZ7ca7Fu2a1CUg7KZ6IZphh0CFFLgjSl2 5sDKH5bQmqtT37sDGNfSUQs9U857eZ5/Gc6EPXkssfityC0Z5M+yx+n5/WQqIusriyZe Z1YLxfkpE4g6jlf8D7UPhKLFIC4nDqnoWlL2MJYnlbIIBDptFPUQSS6dQTc6dn11R+1f BQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2k2p7vpdkj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jul 2018 06:49:02 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6D6n0bd014108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jul 2018 06:49:01 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6D6moCf018657; Fri, 13 Jul 2018 06:48:51 GMT Received: from mwanda (/41.202.241.32) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Jul 2018 23:48:49 -0700 Date: Fri, 13 Jul 2018 09:48:16 +0300 From: Dan Carpenter To: Tuomas Tynkkynen Cc: Greg Kroah-Hartman , Stefan Wahren , devel@driverdev.osuosl.org, 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 Message-ID: <20180713064816.lv6qhkipi6fpeptj@mwanda> References: <20180712215417.22491-1-tuomas@tuxera.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712215417.22491-1-tuomas@tuxera.com> User-Agent: NeoMutt/20170609 (1.8.3) 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=800 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 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. regards, dan carpenter