Skip to content

Commit

Permalink
ptp: fix panic if run rx timing with pf (#913)
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Du <frank.du@intel.com>
  • Loading branch information
frankdjx authored Jun 26, 2024
1 parent 509eb8f commit d2f8ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/src/mt_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,8 +1559,12 @@ static int ptp_stat(void* priv) {
int mt_ptp_init(struct mtl_main_impl* impl) {
int socket = mt_socket_id(impl, MTL_PORT_P);
int ret;
int num_port = mt_num_ports(impl);

for (int i = 0; i < num_port; i++) {
/* only probe on the MTL_PORT_P */
if ((i != MTL_PORT_P) && !mt_if_has_offload_timestamp(impl, i)) continue;

for (int i = 0; i < 1; i++) { /* only probe on the MTL_PORT_P */
struct mt_ptp_impl* ptp = mt_rte_zmalloc_socket(sizeof(*ptp), socket);
if (!ptp) {
err("%s(%d), ptp malloc fail\n", __func__, i);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/st2110/st_rx_video_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ static int rv_handle_detect_pkt(struct st_rx_video_session_impl* s, struct rte_m
ops->fps = meta->fps;
ops->packing = meta->packing;
ops->interlaced = meta->interlaced;
if (ops->notify_detected) {
if (ops->notify_detected && (ops->flags & ST20_RX_FLAG_AUTO_DETECT)) {
struct st20_detect_reply reply = {0};
ret = ops->notify_detected(ops->priv, meta, &reply);
if (ret < 0) {
Expand Down

0 comments on commit d2f8ffe

Please sign in to comment.