* [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result
@ 2016-01-29 12:44 Imre Deak
2016-01-29 12:44 ` [PATCH 2/2] drm/mst: Add range check for max_payloads during init Imre Deak
2016-01-29 13:52 ` [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result David Weinehall
0 siblings, 2 replies; 4+ messages in thread
From: Imre Deak @ 2016-01-29 12:44 UTC (permalink / raw)
To: dri-devel; +Cc: Dave Airlie
Otherwise this call would have no effect.
Caught by Coverity.
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 6ed90a2..8f749e6 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2854,7 +2854,9 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
if (!mgr->proposed_vcpis)
return -ENOMEM;
set_bit(0, &mgr->payload_mask);
- test_calc_pbn_mode();
+ if (test_calc_pbn_mode() < 0)
+ DRM_ERROR("MST PBN self-test failed\n");
+
return 0;
}
EXPORT_SYMBOL(drm_dp_mst_topology_mgr_init);
--
2.5.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] drm/mst: Add range check for max_payloads during init
2016-01-29 12:44 [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result Imre Deak
@ 2016-01-29 12:44 ` Imre Deak
2016-01-29 13:52 ` David Weinehall
2016-01-29 13:52 ` [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result David Weinehall
1 sibling, 1 reply; 4+ messages in thread
From: Imre Deak @ 2016-01-29 12:44 UTC (permalink / raw)
To: dri-devel; +Cc: Dave Airlie
max_payload is limited by the space we have in
drm_dp_mst_topology_mgr::vcpi_mask,payload_mask. We need to track
max_payloads+1 IDs in these masks, see drm_dp_mst_assign_payload_id().
Add a sanity check for this.
Caught by coverity.
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 8f749e6..05c2702 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2847,6 +2847,9 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
mgr->max_dpcd_transaction_bytes = max_dpcd_transaction_bytes;
mgr->max_payloads = max_payloads;
mgr->conn_base_id = conn_base_id;
+ if (max_payloads + 1 > sizeof(mgr->payload_mask) * 8 ||
+ max_payloads + 1 > sizeof(mgr->vcpi_mask) * 8)
+ return -EINVAL;
mgr->payloads = kcalloc(max_payloads, sizeof(struct drm_dp_payload), GFP_KERNEL);
if (!mgr->payloads)
return -ENOMEM;
--
2.5.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result
2016-01-29 12:44 [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result Imre Deak
2016-01-29 12:44 ` [PATCH 2/2] drm/mst: Add range check for max_payloads during init Imre Deak
@ 2016-01-29 13:52 ` David Weinehall
1 sibling, 0 replies; 4+ messages in thread
From: David Weinehall @ 2016-01-29 13:52 UTC (permalink / raw)
To: Imre Deak; +Cc: Dave Airlie, dri-devel
On Fri, Jan 29, 2016 at 02:44:28PM +0200, Imre Deak wrote:
> Otherwise this call would have no effect.
>
> Caught by Coverity.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: David Weinehall <david.weinehall@intel.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 6ed90a2..8f749e6 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -2854,7 +2854,9 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
> if (!mgr->proposed_vcpis)
> return -ENOMEM;
> set_bit(0, &mgr->payload_mask);
> - test_calc_pbn_mode();
> + if (test_calc_pbn_mode() < 0)
> + DRM_ERROR("MST PBN self-test failed\n");
> +
> return 0;
> }
> EXPORT_SYMBOL(drm_dp_mst_topology_mgr_init);
> --
> 2.5.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm/mst: Add range check for max_payloads during init
2016-01-29 12:44 ` [PATCH 2/2] drm/mst: Add range check for max_payloads during init Imre Deak
@ 2016-01-29 13:52 ` David Weinehall
0 siblings, 0 replies; 4+ messages in thread
From: David Weinehall @ 2016-01-29 13:52 UTC (permalink / raw)
To: Imre Deak; +Cc: Dave Airlie, dri-devel
On Fri, Jan 29, 2016 at 02:44:29PM +0200, Imre Deak wrote:
> max_payload is limited by the space we have in
> drm_dp_mst_topology_mgr::vcpi_mask,payload_mask. We need to track
> max_payloads+1 IDs in these masks, see drm_dp_mst_assign_payload_id().
> Add a sanity check for this.
>
> Caught by coverity.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: David Weinehall <david.weinehall@intel.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 8f749e6..05c2702 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -2847,6 +2847,9 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
> mgr->max_dpcd_transaction_bytes = max_dpcd_transaction_bytes;
> mgr->max_payloads = max_payloads;
> mgr->conn_base_id = conn_base_id;
> + if (max_payloads + 1 > sizeof(mgr->payload_mask) * 8 ||
> + max_payloads + 1 > sizeof(mgr->vcpi_mask) * 8)
> + return -EINVAL;
> mgr->payloads = kcalloc(max_payloads, sizeof(struct drm_dp_payload), GFP_KERNEL);
> if (!mgr->payloads)
> return -ENOMEM;
> --
> 2.5.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-29 13:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29 12:44 [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result Imre Deak
2016-01-29 12:44 ` [PATCH 2/2] drm/mst: Add range check for max_payloads during init Imre Deak
2016-01-29 13:52 ` David Weinehall
2016-01-29 13:52 ` [PATCH 1/2] drm/mst: Don't ignore the MST PBN self-test result David Weinehall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox