)]}'
{
  "commit": "4d3721b204f961e905714954ff95633337b768e3",
  "tree": "d5328460746e8d55c9c701ac9e1e9d70abc1cda4",
  "parents": [
    "73f46553fd74a1fc56eb2e6218ff3a4ea1de43b5"
  ],
  "author": {
    "name": "Babanpreet Singh",
    "email": "bbnpreetsingh@gmail.com",
    "time": "Tue Jul 14 04:10:10 2026 +0000"
  },
  "committer": {
    "name": "Krzysztof Kozlowski",
    "email": "krzk@kernel.org",
    "time": "Mon Jul 27 20:47:01 2026 +0200"
  },
  "message": "w1: ds2482: Fix signedness bug in ds2482_w1_triplet()\n\nds2482_wait_1wire_idle() returns the status register value (0..255) on\nsuccess, or a negative value on I2C failure: -1 when selecting the\nstatus register fails, or a negative errno from i2c_smbus_read_byte().\n\nds2482_w1_triplet() feeds that result into \"return (status \u003e\u003e 5);\"\nwithout checking for errors, and the function returns u8. For a\nnegative status the arithmetic shift keeps the sign and the u8\ntruncation fabricates a triplet result whose meaning depends on the\nerrno value: -1 and -EIO happen to become 0xff, whose set low bits make\nw1_search() abort, but -ETIMEDOUT (-110 \u003e\u003e 5 \u003d -4) becomes 0xfc -\n\"devices responded on both branches, wrote 1\" - and -EOPNOTSUPP\n(-95 \u003e\u003e 5 \u003d -3) becomes 0xfd - \"only the zero branch responded\".\nw1_search() then continues the ROM search with a fabricated direction\nbit instead of aborting, and the corrupted id is either rejected by the\nROM CRC (existing device missed) or registers a phantom slave.\n\nThe function already defines an in-band error value: status is\ninitialized to (3 \u003c\u003c 5), which decodes to 3 (both branch bits set, \"no\ndevice responded\") and makes w1_search() terminate the search when\nsending the triplet command fails. Decode a negative status to the same\nvalue.\n\nFound by smatch:\ndrivers/w1/masters/ds2482.c:314 ds2482_w1_triplet() warn: signedness bug returning \u0027(-67108864)\u0027\n\nFixes: baf12ae29ab4 (\"[PATCH] W1: Add the DS2482 I2C-to-w1 bridge driver.\")\nAssisted-by: Claude:claude-sonnet-5\nSigned-off-by: Babanpreet Singh \u003cbbnpreetsingh@gmail.com\u003e\nLink: https://patch.msgid.link/20260714041011.7-1-bbnpreetsingh@gmail.com\nSigned-off-by: Krzysztof Kozlowski \u003ckrzk@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9e57c6e487d1cb4b4a690f7e54a14410d18b8844",
      "old_mode": 33188,
      "old_path": "drivers/w1/masters/ds2482.c",
      "new_id": "cbd11bc6127493b59b315b9ebdca39cdc4e5929b",
      "new_mode": 33188,
      "new_path": "drivers/w1/masters/ds2482.c"
    }
  ]
}
