[OpenWrt-Devel] [PATCH] umbim: add home provider query support
Ingo Feinerer
feinerer at logic.at
Sun Aug 4 07:08:25 EDT 2019
On Sun, Aug 04, 2019 at 10:25:01AM +0200, John Crispin wrote:
> > +static int
> > +mbim_home_provider_response(void *buffer, size_t len)
> > +{
> > + struct mbim_basic_connect_home_provider_r *state = (struct mbim_basic_connect_home_provider_r *) buffer;
> > + char *provider_id, *provider_name;
> > +
> > + if (len < sizeof(struct mbim_basic_connect_home_provider_r)) {
> > + fprintf(stderr, "message not long enough\n");
> > + return -1;
> > + }
> > + struct mbimprovider *provider = &state->provider;
>
> please move this to the start of the function
Thanks for the remark. I moved the declaration to the start of the
function but kept the initialization below the length check (with the
idea to better not touch the struct if something is known to be wrong
with it).
Best regards,
Ingo
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list