From patchwork Tue Apr 20 23:03:00 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: 93774 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 o3KN2Bl4003722 for ; Tue, 20 Apr 2010 23:02:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558Ab0DTXCK (ORCPT ); Tue, 20 Apr 2010 19:02:10 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:54848 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118Ab0DTXCH (ORCPT ); Tue, 20 Apr 2010 19:02:07 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3KN23rj011461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Apr 2010 18:02:03 -0500 Received: from emcc1.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o3KN22lh000210; Tue, 20 Apr 2010 18:02:02 -0500 (CDT) Received: from localhost.localdomain (x0076199-desktop.sasken-mty.naucm.ext.ti.com [10.87.230.107]) by emcc1.sasken-mty.naucm.ext.ti.com (8.13.8+Sun/8.13.8) with ESMTP id o3KN206A021769; Tue, 20 Apr 2010 18:02:02 -0500 (CDT) From: Ernesto Ramos To: linux-omap@vger.kernel.org Cc: felipe.contreras@nokia.com, ameya.palande@nokia.com, hiroshi.doyu@nokia.com, Ernesto Ramos Subject: [PATCH 5/5v3] DSPBRIDGE: Avoid errors if stream id is zero Date: Tue, 20 Apr 2010 18:03:00 -0500 Message-Id: <1271804580-17072-5-git-send-email-ernesto@ti.com> X-Mailer: git-send-email 1.5.4.5 In-Reply-To: <1271804580-17072-4-git-send-email-ernesto@ti.com> References: <1271804580-17072-1-git-send-email-ernesto@ti.com> <1271804580-17072-2-git-send-email-ernesto@ti.com> <1271804580-17072-3-git-send-email-ernesto@ti.com> <1271804580-17072-4-git-send-email-ernesto@ti.com> 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]); Tue, 20 Apr 2010 23:02:13 +0000 (UTC) diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 7c52c6b..4a4e133 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; } @@ -1691,6 +1691,7 @@ u32 strmwrap_open(union Trapped_Args *args, void *pr_ctxt) struct strm_res_object *strm_res_obj; struct dsp_streamattrin strm_attr_in; struct node_res_object *node_res; + int strmid; find_node_handle(&node_res, pr_ctxt, args->args_strm_open.hnode); @@ -1712,7 +1713,10 @@ u32 strmwrap_open(union Trapped_Args *args, void *pr_ctxt) args->args_strm_open.direction, 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)) { + strmid = strm_res_obj->id + 1; + CP_TO_USR(args->args_strm_open.ph_stream, &strmid, status, 1); + } return status; }