Re: [PATCH RFC] nfs: initialize timeout variable in nfs4_proc_setclientid_confirm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2008-06-24 at 20:25 +0300, Benny Halevy wrote:
> gcc (4.3.0) rightfully warns about this:
> /usr0/export/dev/bhalevy/git/linux-pnfs-bh-nfs41/fs/nfs/nfs4proc.c: In function ‘nfs4_proc_setclientid_confirm’:
> /usr0/export/dev/bhalevy/git/linux-pnfs-bh-nfs41/fs/nfs/nfs4proc.c:2936: warning: ‘timeout’ may be used uninitialized in this function
> 
> nfs4_delay that's passed a pointer to 'timeout' is looking at its value
> and sets it up to some value in the range: NFS4_POLL_RETRY_MIN..NFS4_POLL_RETRY_MAX
> 	if (*timeout <= 0)
> 		*timeout = NFS4_POLL_RETRY_MIN;
> 	if (*timeout > NFS4_POLL_RETRY_MAX)
> 		*timeout = NFS4_POLL_RETRY_MAX;
> 
> Therefore it will end up set to some sane, though rather indeterministic, value.
> 
> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
> ---
> 
> Trond, this patch merely initializes timeout to 0 which will
> result in it set eventually to NFS4_POLL_RETRY_MIN.
> Is this appropriate?

ACK. Since the existing will always return sane values, and nobody has
complained yet, I'll queue this up for 2.6.27 rather than pushing it as
a hotfix.

Thanks!
  Trond

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux