Merge "usb: gadget: f_gsi: bail out if opts is null"

This commit is contained in:
QCTECMDR Service 2024-09-02 23:10:37 -07:00 committed by Gerrit - the friendly Code Review server
commit e3bfd6c700

View File

@ -3544,6 +3544,9 @@ static struct config_item_type gsi_func_rndis_type = {
static void gsi_inst_clean(struct gsi_opts *opts) static void gsi_inst_clean(struct gsi_opts *opts)
{ {
if (!opts)
return;
if (opts->gsi->c_port.cdev.dev) { if (opts->gsi->c_port.cdev.dev) {
struct cdev *cdev = &opts->gsi->c_port.cdev; struct cdev *cdev = &opts->gsi->c_port.cdev;
int minor = MINOR(cdev->dev); int minor = MINOR(cdev->dev);
@ -3626,7 +3629,7 @@ static void gsi_free_inst(struct usb_function_instance *f)
enum ipa_usb_teth_prot prot_id; enum ipa_usb_teth_prot prot_id;
struct f_gsi *gsi; struct f_gsi *gsi;
if (!opts->gsi) if (!opts || !opts->gsi)
return; return;
prot_id = opts->gsi->prot_id; prot_id = opts->gsi->prot_id;