From patchwork Sat Apr 17 03:28:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ramos Falcon, Ernesto" X-Patchwork-Id: 93274 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3H3Okw3020235 for ; Sat, 17 Apr 2010 03:28:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758729Ab0DQD2W (ORCPT ); Fri, 16 Apr 2010 23:28:22 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:43541 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758713Ab0DQD2W convert rfc822-to-8bit (ORCPT ); Fri, 16 Apr 2010 23:28:22 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3H3SIlk004207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Apr 2010 22:28:18 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o3H3SHtA015387; Fri, 16 Apr 2010 22:28:17 -0500 (CDT) Received: from dsbe71.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o3H3SHSN022887; Fri, 16 Apr 2010 22:28:17 -0500 (CDT) Received: from dlee01.ent.ti.com ([157.170.170.12]) by dsbe71.ent.ti.com ([156.117.232.23]) with mapi; Fri, 16 Apr 2010 22:28:17 -0500 From: "Ramos Falcon, Ernesto" To: "linux-omap@vger.kernel.org" CC: Ameya Palande , "Doyu Hiroshi (Nokia-D/Helsinki)" , "Contreras Felipe (Nokia-D/Helsinki)" Date: Fri, 16 Apr 2010 22:28:16 -0500 Subject: [PATCH 5/5] DSPBRIDGE: Avoid errors if stream id is zero Thread-Topic: [PATCH 5/5] DSPBRIDGE: Avoid errors if stream id is zero Thread-Index: Acrd3gTVED2P6HesRjOt81wjxKzBtQ== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 17 Apr 2010 03:28:23 +0000 (UTC) diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 9d63b1f..43e8186 100644 --- a/drivers/dsp/bridge/pmgr/wcd.c +++ b/drivers/dsp/bridge/pmgr/wcd.c @@ -1498,7 +1498,7 @@ inline void find_strm_handle(struct strm_res_object **strmres, { rcu_read_lock(); *strmres = idr_find(((struct process_context *)pr_ctxt)->strm_idp, - (int)hstream); + (int)hstream - 1); rcu_read_unlock(); return; } @@ -1713,6 +1713,8 @@ u32 strmwrap_open(union Trapped_Args *args, void *pr_ctxt) args->args_strm_open.index, &attr, &strm_res_obj, pr_ctxt); CP_TO_USR(args->args_strm_open.ph_stream, &strm_res_obj->id, status, 1); + if (DSP_SUCCEEDED(status)) + *args->args_strm_open.ph_stream += 1; return status; }