diff options
author | 2013-03-30 15:00:22 +0000 | |
---|---|---|
committer | 2013-03-30 15:00:22 +0000 | |
commit | 343cd6b35d200a73754d64b522f1472b8e6c642b (patch) | |
tree | 93d1d697d9465347c57844f14e2e5fd5f2ef6040 | |
parent | Provide wrappers for scsi_io_get() and scsi_io_put(), that also include (diff) | |
download | wireguard-openbsd-343cd6b35d200a73754d64b522f1472b8e6c642b.tar.xz wireguard-openbsd-343cd6b35d200a73754d64b522f1472b8e6c642b.zip |
Two fixes to intel_sdvo_write_cmd():
- Allocate a large enugh buffer to store messages.
- Make sure we return true if we sucessfully transferred the command.
Makes it possible to actually talk to the SDVO chip on the other end.
-rw-r--r-- | sys/dev/pci/drm/i915/intel_sdvo.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915/intel_sdvo.c b/sys/dev/pci/drm/i915/intel_sdvo.c index ebe21b47eaa..7432197cc3c 100644 --- a/sys/dev/pci/drm/i915/intel_sdvo.c +++ b/sys/dev/pci/drm/i915/intel_sdvo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_sdvo.c,v 1.3 2013/03/30 12:36:50 kettenis Exp $ */ +/* $OpenBSD: intel_sdvo.c,v 1.4 2013/03/30 15:00:22 kettenis Exp $ */ /* * Copyright 2006 Dave Airlie <airlied@linux.ie> * Copyright © 2006-2007 Intel Corporation @@ -583,7 +583,7 @@ intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, if (!buf) return false; - msgs = malloc(args_len + 3 * sizeof(*msgs), M_DRM, + msgs = malloc((args_len + 3) * sizeof(*msgs), M_DRM, M_WAITOK | M_ZERO); if (!msgs) { free(buf, M_DRM); @@ -626,9 +626,12 @@ intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, if (ret) { DRM_DEBUG_KMS("sdvo i2c transfer failed\n"); ret = false; - break; + goto out; } } + ret = true; + +out: iic_release_bus(intel_sdvo->i2c, 0); free(msgs, M_DRM); |