public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Lakshminarayana Vudum <lakshminarayana.vudum@intel.com>
Subject: [igt-dev] [PATCH i-g-t] lib/intel_iosf: Fix bad parameters were passed to functions
Date: Tue,  3 Sep 2019 14:14:17 +0200	[thread overview]
Message-ID: <20190903121417.11112-1-daniel.t.mrzyglod@intel.com> (raw)

There was bad parameters passed to intel_register_read() & intel_register_write()
and Dereferencing and accessing a non existant structure data member
resulting SEGFAULT

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111534
Fixes: d38950f2c0ca ("lib/intel_mmio: add additional api for multiple devices")

Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lakshminarayana Vudum <lakshminarayana.vudum@intel.com>

Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
---
 lib/intel_iosf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/intel_iosf.c b/lib/intel_iosf.c
index 16862ef4..40525b06 100644
--- a/lib/intel_iosf.c
+++ b/lib/intel_iosf.c
@@ -49,7 +49,7 @@ static int vlv_sideband_rw(struct intel_mmio_data *mmio_data, uint32_t port,
 	do {
 		usleep(1);
 		timeout++;
-	} while (intel_register_read(mmio_data->igt_mmio,
+	} while (intel_register_read(mmio_data,
 				     VLV_IOSF_DOORBELL_REQ) &
 		IOSF_SB_BUSY && timeout < TIMEOUT_US);
 
@@ -59,8 +59,8 @@ static int vlv_sideband_rw(struct intel_mmio_data *mmio_data, uint32_t port,
 	}
 
 	if (is_read)
-		*val = intel_register_read(mmio_data->igt_mmio, VLV_IOSF_DATA);
-	intel_register_write(mmio_data->igt_mmio, VLV_IOSF_DATA, 0);
+		*val = intel_register_read(mmio_data, VLV_IOSF_DATA);
+	intel_register_write(mmio_data, VLV_IOSF_DATA, 0);
 
 	return 0;
 }
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-09-03 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 12:14 Daniel Mrzyglod [this message]
2019-09-03 12:43 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/intel_iosf: Fix bad parameters were passed to functions Patchwork
2019-09-03 15:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-09-04 13:00 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190903121417.11112-1-daniel.t.mrzyglod@intel.com \
    --to=daniel.t.mrzyglod@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lakshminarayana.vudum@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox