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>
Wed, 12 Jul 2017 13:01:03 +0000 (15:01 +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 aaaf256f71dd63091aec15f0e6b64eaec03ef8f0..4cf5381ff9914f6f6b139a4c82d76865f9d515a2 100644 (file)
@@ -231,7 +231,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 =
index a7e28095026d1c585d11132eb16df7b44b165b06..f92c680e393798904c0b98b982fc3dd5fe05ec7c 100644 (file)
@@ -1069,9 +1069,9 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
                return -ESHUTDOWN;
        }
 
-       if (WARN(req->dep != dep, "request %p belongs to '%s'\n",
+       if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
                                &req->request, req->dep->name)) {
-               dwc3_trace(trace_dwc3_gadget, "request %p belongs to '%s'",
+               dwc3_trace(trace_dwc3_gadget, "request %pK belongs to '%s'",
                                &req->request, req->dep->name);
                return -EINVAL;
        }
@@ -1212,7 +1212,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;