lkml.org 
[lkml]   [2021]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v0 16/42] USB: Check notifier registration return value
    On Mon, Nov 08, 2021 at 11:11:31AM +0100, Borislav Petkov wrote:
    > From: Borislav Petkov <bp@suse.de>
    >
    > Avoid homegrown notifier registration checks.

    This is a rather misleading description. The patch does exactly the
    opposite: It _adds_ a homegrown notifier registration check. (Homegrown
    in the sense that the check is made by the individual caller rather than
    being centralized in the routine being called.)

    Alan Stern

    > No functional changes.
    >
    > Signed-off-by: Borislav Petkov <bp@suse.de>
    > Cc: linux-usb@vger.kernel.org
    > ---
    > drivers/usb/core/notify.c | 3 ++-
    > 1 file changed, 2 insertions(+), 1 deletion(-)
    >
    > diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c
    > index e6143663778f..80d1bfa61887 100644
    > --- a/drivers/usb/core/notify.c
    > +++ b/drivers/usb/core/notify.c
    > @@ -28,7 +28,8 @@ static BLOCKING_NOTIFIER_HEAD(usb_notifier_list);
    > */
    > void usb_register_notify(struct notifier_block *nb)
    > {
    > - blocking_notifier_chain_register(&usb_notifier_list, nb);
    > + if (blocking_notifier_chain_register(&usb_notifier_list, nb))
    > + pr_warn("USB change notifier already registered\n");
    > }
    > EXPORT_SYMBOL_GPL(usb_register_notify);
    >
    > --
    > 2.29.2
    >

    \
     
     \ /
      Last update: 2021-11-08 15:15    [W:3.943 / U:1.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site