Skip to content

Commit c813008

Browse files
Felipe Balbigregkh
authored andcommitted
usb: dwc3: replace %p with %pK
commit 04fb365c453e14ff9e8a28f1c46050d920a27a4a upstream. %p will leak kernel pointers, so let's not expose the information on dmesg and instead use %pK. %pK will only show the actual addresses if explicitly enabled under /proc/sys/kernel/kptr_restrict. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a080ec4 commit c813008

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/usb/dwc3/dwc3-st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
224224

225225
dwc3_data->syscfg_reg_off = res->start;
226226

227-
dev_vdbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
227+
dev_vdbg(&pdev->dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
228228
dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
229229

230230
dwc3_data->rstc_pwrdn = devm_reset_control_get(dev, "powerdown");

drivers/usb/dwc3/gadget.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
12191219
goto out;
12201220
}
12211221

1222-
if (WARN(req->dep != dep, "request %p belongs to '%s'\n",
1222+
if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
12231223
request, req->dep->name)) {
12241224
ret = -EINVAL;
12251225
goto out;
@@ -1264,7 +1264,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
12641264
dwc3_stop_active_transfer(dwc, dep->number, true);
12651265
goto out1;
12661266
}
1267-
dev_err(dwc->dev, "request %p was not queued to %s\n",
1267+
dev_err(dwc->dev, "request %pK was not queued to %s\n",
12681268
request, ep->name);
12691269
ret = -EINVAL;
12701270
goto out0;
@@ -1866,7 +1866,7 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep,
18661866
* would help. Lets hope that if this occurs, someone
18671867
* fixes the root cause instead of looking away :)
18681868
*/
1869-
dev_err(dwc->dev, "%s's TRB (%p) still owned by HW\n",
1869+
dev_err(dwc->dev, "%s's TRB (%pK) still owned by HW\n",
18701870
dep->name, trb);
18711871
count = trb->size & DWC3_TRB_SIZE_MASK;
18721872

0 commit comments

Comments
 (0)