On Mon, Jun 08, 2020 at 11:48:51AM -0400, Jim Quinlan wrote:
> On Sun, Jun 7, 2020 at 12:500f9bfe0fb8840b268af1bbcc51f1cd440514e PM
> Andy Shevchenko <andriy.shevche...@linux.intel.com> wrote:
> > On Fri, Jun 05, 2020 at 05:26:48PM -0400, Jim Quinlan wrote:

...

> > > +     *map_size = (num_ranges + 1) * sizeof(**map);
> > > +     r = kzalloc(*map_size, GFP_KERNEL);
> >
> > kcalloc()
> Since I have to calculate the size anyway I thought kzalloc was fine.
> I'll switch.

The point is to check multiplication overflow. See overflow.h for helpers.

> > > +     if (!r)
> > > +             return -ENOMEM;

-- 
With Best Regards,
Andy Shevchenko


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to