Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: Use sysfs_emit_at when concatenating the string

The buffer address used in sysfs_emit should be aligned to PAGE_SIZE.
Use sysfs_emit_at instead to offset the buffer.

Fixes: a7cff92f0635 ("usb: typec: USB Power Delivery helpers for ports and partners")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Tso <kyletso@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230623151036.3955013-4-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kyle Tso and committed by
Greg Kroah-Hartman
609fded3 4b642dc9

+2 -2
+2 -2
drivers/usb/typec/class.c
··· 1288 1288 1289 1289 for (i = 0; pds[i]; i++) { 1290 1290 if (pds[i] == port->pd) 1291 - ret += sysfs_emit(buf + ret, "[%s] ", dev_name(&pds[i]->dev)); 1291 + ret += sysfs_emit_at(buf, ret, "[%s] ", dev_name(&pds[i]->dev)); 1292 1292 else 1293 - ret += sysfs_emit(buf + ret, "%s ", dev_name(&pds[i]->dev)); 1293 + ret += sysfs_emit_at(buf, ret, "%s ", dev_name(&pds[i]->dev)); 1294 1294 } 1295 1295 1296 1296 buf[ret - 1] = '\n';