)]}'
{
  "commit": "ed48a84a72fefb20a82dd90a7caa7807e90c6f66",
  "tree": "662eabd4c672cc406edbb92da62fd2115e0b5f9c",
  "parents": [
    "de5720f91b0b64c603f14da3c6298cba4febeb01"
  ],
  "author": {
    "name": "Junrui Luo",
    "email": "moonafterrain@outlook.com",
    "time": "Wed Jan 28 16:07:34 2026 +0800"
  },
  "committer": {
    "name": "Jakub Kicinski",
    "email": "kuba@kernel.org",
    "time": "Thu Jan 29 18:33:56 2026 -0800"
  },
  "message": "dpaa2-switch: prevent ZERO_SIZE_PTR dereference when num_ifs is zero\n\nThe driver allocates arrays for ports, FDBs, and filter blocks using\nkcalloc() with ethsw-\u003esw_attr.num_ifs as the element count. When the\ndevice reports zero interfaces (either due to hardware configuration\nor firmware issues), kcalloc(0, ...) returns ZERO_SIZE_PTR (0x10)\ninstead of NULL.\n\nLater in dpaa2_switch_probe(), the NAPI initialization unconditionally\naccesses ethsw-\u003eports[0]-\u003enetdev, which attempts to dereference\nZERO_SIZE_PTR (address 0x10), resulting in a kernel panic.\n\nAdd a check to ensure num_ifs is greater than zero after retrieving\ndevice attributes. This prevents the zero-sized allocations and\nsubsequent invalid pointer dereference.\n\nReported-by: Yuhao Jiang \u003cdanisjiang@gmail.com\u003e\nReported-by: Junrui Luo \u003cmoonafterrain@outlook.com\u003e\nFixes: 0b1b71370458 (\"staging: dpaa2-switch: handle Rx path on control interface\")\nSigned-off-by: Junrui Luo \u003cmoonafterrain@outlook.com\u003e\nReviewed-by: Andrew Lunn \u003candrew@lunn.ch\u003e\nLink: https://patch.msgid.link/SYBPR01MB7881BEABA8DA896947962470AF91A@SYBPR01MB7881.ausprd01.prod.outlook.com\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b1e1ad9e4b48e644a42a18b0e3202e948bda7e2e",
      "old_mode": 33188,
      "old_path": "drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c",
      "new_id": "0ff234f6a3ed972eba52812af0180bbeeb0714c2",
      "new_mode": 33188,
      "new_path": "drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c"
    }
  ]
}
