[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32855f4c-f219-4396-81c3-42cbea9fe4da@moroto.mountain>
Date: Tue, 30 Apr 2024 10:17:59 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Jameson Thies <jthies@...gle.com>
Cc: heikki.krogerus@...ux.intel.com, linux-usb@...r.kernel.org,
pmalani@...omium.org, bleung@...gle.com,
abhishekpandit@...omium.org, andersson@...nel.org,
dmitry.baryshkov@...aro.org, fabrice.gasnier@...s.st.com,
gregkh@...uxfoundation.org, hdegoede@...hat.com,
neil.armstrong@...aro.org, rajaram.regupathy@...el.com,
saranya.gopal@...el.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/4] usb: typec: ucsi: Fix null deref in trace
On Wed, Apr 24, 2024 at 01:48:18AM +0000, Jameson Thies wrote:
> From: Abhishek Pandit-Subedi <abhishekpandit@...omium.org>
>
> ucsi_register_altmode checks IS_ERR on returned pointer and treats
> NULL as valid. This results in a null deref when
> trace_ucsi_register_altmode is called. Return an error from
> ucsi_register_displayport when it is not supported and register the
> altmode with typec_port_register_altmode.
>
> Reviewed-by: Jameson Thies <jthies@...gle.com>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@...omium.org>
This is not the correct way to fix this. The normal thing to do would
be to add NULL checks.
https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/'
regards,
dan carpenter
Powered by blists - more mailing lists