From patchwork Mon Apr 6 23:10:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 46795 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C61F0214B1 for ; Mon, 6 Apr 2015 23:10:27 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf9043963lbc.1 for ; Mon, 06 Apr 2015 16:10:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Ynyuz9JpLMrSJuwjQry6bcXdUwNCyCqLofvJ8dgQVXY=; b=bRJAyZa07jjSq6ZDVXYytiRyERGpcX695Cl9aCQgpYJDoIJqXkt765e6Jj48UiF293 /CB1wtkzQvpTcbSBrQ37pG814rYQRC3BqA4rK6H6UGuY8oMNUANjuiohRx9iurcg4Ztq E3uauSozRI8ooX2LVS5eLecn5C2vAIptFQMfIJsfqRurTe6ItwG2oyApJpWp577Jji58 9QWg5u++0m5wVFVwmUlK56zcGOjZCg44tMDTnfELb9Qzd1oF4Xd2WCsEtgOygus2Gfvx LgaluX0Ro5pevFwVCW1SWT0elxVyGOio2Gdm5TuRdY1OWVGfgtKUQg+dyHJZniSBGLv1 QZ2A== X-Gm-Message-State: ALoCoQlEO6veWRgAqII5rKu1Zwzsl0ksPl8WzFJU4i52lojBnvn9EDvHC9bOw3kFVr76RA0MXJIT X-Received: by 10.112.203.168 with SMTP id kr8mr1204665lbc.10.1428361826610; Mon, 06 Apr 2015 16:10:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.36 with SMTP id yf4ls626286lab.43.gmail; Mon, 06 Apr 2015 16:10:26 -0700 (PDT) X-Received: by 10.152.88.46 with SMTP id bd14mr15351504lab.71.1428361826402; Mon, 06 Apr 2015 16:10:26 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id l5si4559998lbt.73.2015.04.06.16.10.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 16:10:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labbd9 with SMTP id bd9so18459069lab.2 for ; Mon, 06 Apr 2015 16:10:26 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr15158793lbb.76.1428361826263; Mon, 06 Apr 2015 16:10:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.67.65 with SMTP id l1csp92163lbt; Mon, 6 Apr 2015 16:10:25 -0700 (PDT) X-Received: by 10.66.240.228 with SMTP id wd4mr30913792pac.80.1428361824496; Mon, 06 Apr 2015 16:10:24 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com. [209.85.220.43]) by mx.google.com with ESMTPS id xf4si8483687pbc.157.2015.04.06.16.10.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 16:10:24 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.43 as permitted sender) client-ip=209.85.220.43; Received: by paboj16 with SMTP id oj16so58445746pab.0 for ; Mon, 06 Apr 2015 16:10:23 -0700 (PDT) X-Received: by 10.69.12.227 with SMTP id et3mr31326033pbd.79.1428361823504; Mon, 06 Apr 2015 16:10:23 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id nw14sm5909429pab.39.2015.04.06.16.10.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Apr 2015 16:10:22 -0700 (PDT) From: John Stultz To: projectara-software-dev Cc: mark greer , Alex Elder , Greg Kroah-Hartman , John Stultz Subject: [PATCH 1/3] gbsim: i2s: Fix misuse of header.size which may be endien swapped Date: Mon, 6 Apr 2015 16:10:17 -0700 Message-Id: <1428361819-8899-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Alex noted I was using header.size, which has been endien swapped, and I should instead be using the local sz variable instead. So fix this across the i2s file. Cc: mark greer Cc: Alex Elder Cc: Greg Kroah-Hartman Signed-off-by: John Stultz --- i2s.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/i2s.c b/i2s.c index d4d3ce9..9d9f5a1 100644 --- a/i2s.c +++ b/i2s.c @@ -62,8 +62,8 @@ void i2s_mgmt_handler(__u8 *rbuf, size_t size) gbsim_debug("Module %d -> AP CPort %d I2S SET_CONFIGURATION response\n ", cport_to_module_id(cport_req->cport), cport_rsp->cport); if (verbose) - gbsim_dump((__u8 *)op_rsp, op_rsp->header.size); - write(cport_in, cport_rsp, op_rsp->header.size + 1); + gbsim_dump((__u8 *)op_rsp, sz); + write(cport_in, cport_rsp, sz + 1); break; case GB_I2S_MGMT_TYPE_SET_SAMPLES_PER_MESSAGE: sz = sizeof(struct op_header); @@ -76,8 +76,8 @@ void i2s_mgmt_handler(__u8 *rbuf, size_t size) gbsim_debug("Module %d -> AP CPort %d I2S SET_SAMPLES_PER_MESSAGE response\n ", cport_to_module_id(cport_req->cport), cport_rsp->cport); if (verbose) - gbsim_dump((__u8 *)op_rsp, op_rsp->header.size); - write(cport_in, cport_rsp, op_rsp->header.size + 1); + gbsim_dump((__u8 *)op_rsp, sz); + write(cport_in, cport_rsp, sz + 1); break; case GB_I2S_MGMT_TYPE_SET_START_DELAY: sz = sizeof(struct op_header); @@ -90,8 +90,8 @@ void i2s_mgmt_handler(__u8 *rbuf, size_t size) gbsim_debug("Module %d -> AP CPort %d I2S SET_START_DELAY response\n ", cport_to_module_id(cport_req->cport), cport_rsp->cport); if (verbose) - gbsim_dump((__u8 *)op_rsp, op_rsp->header.size); - write(cport_in, cport_rsp, op_rsp->header.size + 1); + gbsim_dump((__u8 *)op_rsp, sz); + write(cport_in, cport_rsp, sz + 1); break; case GB_I2S_MGMT_TYPE_ACTIVATE_CPORT: sz = sizeof(struct op_header); @@ -104,8 +104,8 @@ void i2s_mgmt_handler(__u8 *rbuf, size_t size) gbsim_debug("Module %d -> AP CPort %d I2S ACTIVATE_CPORT response\n ", cport_to_module_id(cport_req->cport), cport_rsp->cport); if (verbose) - gbsim_dump((__u8 *)op_rsp, op_rsp->header.size); - write(cport_in, cport_rsp, op_rsp->header.size + 1); + gbsim_dump((__u8 *)op_rsp, sz); + write(cport_in, cport_rsp, sz + 1); break; case GB_I2S_MGMT_TYPE_DEACTIVATE_CPORT: sz = sizeof(struct op_header); @@ -118,8 +118,8 @@ void i2s_mgmt_handler(__u8 *rbuf, size_t size) gbsim_debug("Module %d -> AP CPort %d I2S DEACTIVATE_CPORT response\n ", cport_to_module_id(cport_req->cport), cport_rsp->cport); if (verbose) - gbsim_dump((__u8 *)op_rsp, op_rsp->header.size); - write(cport_in, cport_rsp, op_rsp->header.size + 1); + gbsim_dump((__u8 *)op_rsp, sz); + write(cport_in, cport_rsp, sz + 1); break; default: gbsim_error("i2s mgmt operation type %02x not supported\n", oph->type); @@ -161,8 +161,8 @@ void i2s_data_handler(__u8 *rbuf, size_t size) gbsim_debug("Module %d -> AP CPort %d I2S SEND_DATA response\n ", cport_to_module_id(cport_req->cport), cport_rsp->cport); if (verbose) - gbsim_dump((__u8 *)op_rsp, op_rsp->header.size); - write(cport_in, cport_rsp, op_rsp->header.size + 1); + gbsim_dump((__u8 *)op_rsp, sz); + write(cport_in, cport_rsp, sz + 1); break; default: gbsim_error("i2s data operation type %02x not supported\n", oph->type);