On 10/26/26 3:39 PM, Rob Clark wrote:
> On Mon, Oct 26, 2026 at 4:40 AM Konrad Dybcio <[email protected]> wrote:
>>
>> From: Konrad Dybcio <[email protected]>
>>
>> Much of the VM handling code is a headache to read and maintain.
>> There's a soup of mixed-signedness/size types which need to be compared
>> and added and getting that wrong in C is very easy.
[...]
>> @@ -1118,11 +1071,10 @@ vm_bind_job_lookup_ops(struct msm_vm_bind_job *job,
>> struct drm_msm_vm_bind *args
>> op->obj = obj;
>> cnt++;
>>
>> - if ((op->range + op->obj_offset) > obj->size) {
>> - ret = UERR(EINVAL, dev, "invalid range: %016llx +
>> %016llx > %016zx\n",
>> - op->range, op->obj_offset, obj->size);
>> + ret = msm_vm_bind_check_bo_range(dev->dev, op->obj_offset,
>> op->range,
>> + obj->size);
>> + if (ret)
>
> I think the ioctl surface area is a sensible place to start using
> rust.. but seems like this patch could instead be a 1-ish line patch
> to use check_add_overflow() here?
Yeah I said that under the --- line, my main objective here is to
encourage rs
> Big picture, I'm a bit more interested in the
> goto-error-unwind-spagatti-monstors. Even there, just using more
> cleanup.h would be an improvement.
Same. I'm done reviewing gotos. LLMs help a lot, but LLMs probably
prefer Rust too.
Konrad