usb: dwc3: replace %p with %pK
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 17 May 2017 12:57:45 +0000 (15:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jul 2017 08:14:39 +0000 (10:14 +0200)
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>
drivers/usb/dwc3/dwc3-st.c
drivers/usb/dwc3/gadget.c

index c7602b5362add8c1be17d7f8a8a57702724ff7f0..35080d5423531062764ce297d9ad8c8256f7965c 100644 (file)
@@ -227,7 +227,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
 
        dwc3_data->syscfg_reg_off = res->start;
 
-       dev_vdbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
+       dev_vdbg(&pdev->dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
                 dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
 
        dwc3_data->rstc_pwrdn = devm_reset_control_get(dev, "powerdown");
index 2d49d66113ee330a4bd0548e3269915e0bb890d7..6ce78e3ca7c6c32a7451cb9de4faaaee61b8050d 100644 (file)
@@ -1229,7 +1229,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
                        dwc3_stop_active_transfer(dwc, dep->number, true);
                        goto out1;
                }
-               dev_err(dwc->dev, "request %p was not queued to %s\n",
+               dev_err(dwc->dev, "request %pK was not queued to %s\n",
                                request, ep->name);
                ret = -EINVAL;
                goto out0;
@@ -1833,7 +1833,7 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep,
                 * would help. Lets hope that if this occurs, someone
                 * fixes the root cause instead of looking away :)
                 */
-               dev_err(dwc->dev, "%s's TRB (%p) still owned by HW\n",
+               dev_err(dwc->dev, "%s's TRB (%pK) still owned by HW\n",
                                dep->name, trb);
 
        count = trb->size & DWC3_TRB_SIZE_MASK;